C#实现生成Markdown文档目录树( 二 )

搞定 。
实现效果把生成的树结构打印一下
[{"Text": "DjangoAdmin","Href": "#DjangoAdmin","Tags": null,"Nodes": [{"Text": "一些参考资料","Href": "#一些参考资料","Tags": null,"Nodes": null}]},{"Text": "界面主题","Href": "#界面主题","Tags": null,"Nodes": [{"Text": "SimpleUI","Href": "#SimpleUI","Tags": null,"Nodes": [{"Text": "一些相关的参考资料","Href": "#一些相关的参考资料","Tags": null,"Nodes": null}]},{"Text": "django-jazzmin","Href": "#django-jazzmin","Tags": null,"Nodes": null}]},{"Text": "定制案例","Href": "#定制案例","Tags": null,"Nodes": [{"Text": "添加自定义列","Href": "#添加自定义列","Tags": null,"Nodes": [{"Text": "效果图","Href": "#效果图","Tags": null,"Nodes": null},{"Text": "实现过程","Href": "#实现过程","Tags": null,"Nodes": null},{"Text": "扩展:添加链接","Href": "#扩展:添加链接","Tags": null,"Nodes": null}]},{"Text": "显示进度条","Href": "#显示进度条","Tags": null,"Nodes": [{"Text": "效果图","Href": "#效果图","Tags": null,"Nodes": null},{"Text": "实现过程","Href": "#实现过程","Tags": null,"Nodes": null}]},{"Text": "页面上显示合计数额","Href": "#页面上显示合计数额","Tags": null,"Nodes": [{"Text": "效果图","Href": "#效果图","Tags": null,"Nodes": null},{"Text": "实现过程","Href": "#实现过程","Tags": null,"Nodes": [{"Text": "admin.py","Href": "#admin.py","Tags": null,"Nodes": null},{"Text": "template","Href": "#template","Tags": null,"Nodes": null}]},{"Text": "参考资料","Href": "#参考资料","Tags": null,"Nodes": null}]},{"Text": "分权限的软删除","Href": "#分权限的软删除","Tags": null,"Nodes": [{"Text": "实现过程","Href": "#实现过程","Tags": null,"Nodes": [{"Text": "models.py","Href": "#models.py","Tags": null,"Nodes": null},{"Text": "admin.py","Href": "#admin.py","Tags": null,"Nodes": null}]}]}]},{"Text": "扩展工具","Href": "#扩展工具","Tags": null,"Nodes": [{"Text": "Django AdminPlus","Href": "#Django AdminPlus","Tags": null,"Nodes": null},{"Text": "django-adminactions","Href": "#django-adminactions","Tags": null,"Nodes": null}]}]完整代码我把这个功能封装成一个方法,方便调用 。
直接上GitHub Gist:https://gist.github.com/Deali-Axy/436589aaac7c12c91e31fdeb851201bf
接下来可以尝试使用后端来渲染Markdown文章了~
【C#实现生成Markdown文档目录树】

经验总结扩展阅读