feat(task): improve summary extraction in docs generation using Python AST parsing
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -163,7 +163,7 @@ docs() {
|
||||
local module_dir=$(dirname "$manifest_file")
|
||||
local module_name=$(basename "$module_dir")
|
||||
echo "Add summary of $module_name to readme file."
|
||||
local summary=$(grep 'summary' "$manifest_file" -A 1 | tail -1)
|
||||
local summary=$(python3 -c "import ast; d=ast.literal_eval(open('$manifest_file').read()); print(d.get('summary', '').replace('\n', ' ').strip())")
|
||||
echo "| [$module_name]($module_name) | $summary |" >> 'README.md'
|
||||
done
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user