From: Dave P. <dav...@gm...> - 2015-01-31 13:02:35
|
Not quite what you want. I convert all files in current directory to html from md then generate an index file (top level) but use the file names. You may be able to build on that and iterate through directories? Assumes using Linux / bash. If that's the case, see below here=`pwd` pysource=/files/python/mymarkdown.py idx="index.html" idxbn="index" # Create top of index file echo "<html><head><title>Index of Markdown files</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> </head><body> <h2>Index of files</h2> <ol> " >$idx clear for fil in *.md do bn=`nameonly $fil` #echo processing ${bn}.md to ${bn}.html python ${pysource} ${bn}.md ${bn}.html echo "<li><a href='${bn}.html'>${bn}.html</a></li> ">>$idx done # finish of index file echo "</ol></body></html> " >>$idx On 31 January 2015 at 12:25, Albert Williams <alb...@my...> wrote: > Hi all, > Apologies if this was asked before...also apologies if my understanding is > incorrect. > I have a directory/folder structure that has one detail.md file in each > folder. > I am required to parse these .md files & generate a summary.md file at the > root folder level. > The summary.md file should include the some headers from the content of the > detail.md files. > It's to include these in summary.md a different layout format (i.e. a table > format with each detail.md content as a row). > These files are to be generated into static html files with links between > summary.html & detail.html & links back also. > > I've a few questions that I'm hoping someone will be able to help with. > PLEASE! > > 1. Is Python-Markdown the tool for doing this? It looks class, but I just > haven't seen the use cases that allows me to create new .md files from > current .md files. > > 2. Can I generate a summary.md file from parsing certain fields from many > detail.md files. Python/Java would be the preferred languages. > Sorry, I've searched but I haven't seen a use case like this as an example. > > 3. I'll need to generate a static html site from all these .md files. I see > there are a few options here. > I see a few options here, pelican & jekyll being 2. > But can I generate links from summary.md files to detail.md files & also > create links from detail.md files to the root folder summary.md files? > I expect I'd have to code this in .md before converting to .html. > > Thanks again for any support, very much appreciated!!! > Regards, > ACW > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk |