From 886fbf4c35ecb5b0644ef1525407b79ab9d0ab8a Mon Sep 17 00:00:00 2001 From: Thomas LEVEIL Date: Mon, 22 Feb 2016 17:17:45 +0100 Subject: [PATCH] add --replace option to do replacements on generated html. See marchtea/mdtogh#4 --- README.md | 5 ++++ mdtogh/command.py | 58 ++++++++++++++++++++++++++------------------- mdtogh/transform.py | 12 +++++++++- 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 09eefed..ad4b487 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ mdtogh can **convert** your md files into html files like github does with featu * offline renderer * proxy support(respect https\_proxy environment variable) * cache support +* do replacements in produced html documents ##demo @@ -104,6 +105,10 @@ Offline rendering: **Recommanded** options to generate `several files`: $ mdtogh 01.md 02.md + +options to do replacements in the generated files: + + $ mdtogh --replace @@version@@,v1.2.3 01.md For more options: diff --git a/mdtogh/command.py b/mdtogh/command.py index b654f7a..aeb07b1 100644 --- a/mdtogh/command.py +++ b/mdtogh/command.py @@ -14,25 +14,26 @@ is a file or a directory to render, [default: '.'] Options: - --templates= path of templates, it should contains all three files: content.html, toc.html, index.html - --cache_path= path to store style file cache, default to current directory - --system_css using system wide css. - --css when NOT set, css contents are generate into html - --abscss link css with absolute path, use only with --css is set - --gfm Use GitHub-Flavored Markdown, e.g. comments or issues - --context= The repository context, only taken into account with --gfm - --user= GitHub username for API authentication - --pass= GitHub password for API authentication - --toc Generate table of contents - --toc_depth= Max toc depth, default to 2 - --toc_file= You can specific a file to be toc(Just incase you have one) - --book= Generate toc with book info, only used when --toc is set - --offline Use offline renderer - --encoding= encode for file, use only when --offline is set - --refresh clear cached styles & refetch them - --file_reg= when path is a directory, using reg_exp to get file, this reg_exp must obey python's rules - if not set, mdtogh will get all files end with .md or .markdown, Notice: this is case-insensitive. - --timeout=