This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A python script to generate a table of contents (with links) for a GitHub Flavored markdown file. | |
| The file must contain a level one header with a title that contains "Table of Contents". | |
| The script will generate a TOC containing all level 1, 2, and 3 headers. | |
| Run the script like this: | |
| python tocgen.py inFileName outFileName | |
| BEFORE file: | |
| -------------------------------------------------------- | |
| This is my GitHub wiki page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2, json, pprint, re, datetime | |
| import mwparserfromhell | |
| def _parseDate(wikiDate): | |
| ''' Parse a mediawiki date template -- assumes years, month, day | |
| Input: | |
| a mwparser object containing just the date to be parsed | |
| Returns: | |
| datetime.date object of the date | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- プログラミングHaskellのパーサコンビネータの実装をMaybeモナドを使うようにしてみた | |
| -- Programming in Haskell : 8 Chapter | |
| module Parsing where | |
| import Char | |
| import Monad | |
| infixr 5 +++ | |
| newtype Parser a = Parser {getParser :: String -> Maybe (a,String)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # assume the following directory structure where contents of doc/ | |
| # and source/ are already checked into repo., with the exception | |
| # of the _build directory (i,e. you can check in _themes or _sources | |
| # or whatever else). | |
| # | |
| # proj/ | |
| # source/ | |
| # doc/ | |
| # remove doc/_build/html if present |
NewerOlder