def get_kotlin_features(): features_dir = path.join(os.path.dirname(__file__), "kotlin-features") features = [] for feature_meta in yaml.load(open(path.join(features_dir, "kotlin-features.yml"))): file_path = path.join(features_dir, feature_meta['content_file']) with open(file_path) as f: content = f.read().decode('utf-8') content = content.replace("\r\n", "\n") if file_path.endswith(".md"): content = jinja_aware_markdown(content, pages) features.append(Feature(content, feature_meta)) return features
def get_kotlin_features(): features_dir = path.join(os.path.dirname(__file__), "kotlin-features") features = [] for feature_meta in yaml.load(open(path.join(features_dir, "kotlin-features.yml"))): file_path = path.join(features_dir, feature_meta['content_file']) with open(file_path, encoding='utf-8') as f: content = f.read() content = content.replace("\r\n", "\n") if file_path.endswith(".md"): html_content = BeautifulSoup(jinja_aware_markdown(content, pages), 'html.parser') content = process_code_blocks(html_content) features.append(Feature(content, feature_meta)) return features