Skip to content

Commit

Permalink
copied docs to top of script
Browse files Browse the repository at this point in the history
  • Loading branch information
konklone committed Apr 2, 2013
1 parent 6514011 commit fbb0b6d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tasks/structure.py
@@ -1,12 +1,23 @@
# Uses the XHTML files to extract a table of contents for the US Code.
# run with: ./run xhtml_to_structure year=2011 > structure.json
# Defaults to USCprelim.
#
# run with:
# ./run structure > structure.json
#
# options:
# year: "uscprelim" (the default), or a specific year version of the Code (e.g. "2011")
# title: Do only a specific title (e.g. "5", "5a", "25")
# sections: Return a flat hierarchy of only titles and sections (no intervening layers)
# debug: Output debug messages only, and no JSON output (dry run)

import glob, re, lxml.html, json, sys
import HTMLParser

import HTMLParser
pars = HTMLParser.HTMLParser()

section_symbol = u'\xa7'


def run(options):
year = options.get("year", "uscprelim") # default to USCprelim

Expand Down

0 comments on commit fbb0b6d

Please sign in to comment.