26 | 26 |
help='Check if web objects linked to from the entries exist'
|
27 | 27 |
)
|
28 | 28 |
argparser.add_argument('--check-against-schema', metavar='FILENAME', type=str, default=None,
|
29 | |
help='Check if entries have the properties specified by this schema'
|
|
29 |
help='Check if entries have the properties specified by this schema. This schema will '
|
|
30 |
'also provide hints (such as ordering of properties) when outputting Markdown or HTML.'
|
30 | 31 |
)
|
31 | 32 |
argparser.add_argument('--output-atom', metavar='FILENAME', type=str,
|
32 | 33 |
help='Construct an Atom XML feed from the entries and write it out to this file'
|
|
42 | 43 |
)
|
43 | 44 |
argparser.add_argument('--limit', metavar='COUNT', type=int, default=None,
|
44 | 45 |
help='Process no more than this many entries when making an Atom or HTML feed'
|
45 | |
)
|
46 | |
argparser.add_argument('--property-priority-order', metavar='NAMES', type=str, default='',
|
47 | |
help='Comma-seperated list of property names, giving the order in which '
|
48 | |
'properties should be output (in Markdown and HTML)'
|
49 | 46 |
)
|
50 | 47 |
|
51 | 48 |
options = argparser.parse_args(sys.argv[1:])
|
|
74 | 71 |
if options.check_links or options.archive_links_to is not None:
|
75 | 72 |
from feedmark.checkers import archive_links
|
76 | 73 |
result = archive_links(documents, options.archive_links_to)
|
77 | |
write(json.dumps(result, indent=4, sorted=True))
|
|
74 |
write(json.dumps(result, indent=4, sort_keys=True))
|
78 | 75 |
|
|
76 |
schema = None
|
79 | 77 |
if options.check_against_schema is not None:
|
80 | 78 |
from feedmark.checkers import Schema
|
81 | 79 |
schema_document = read_document_from(options.check_against_schema)
|
|
89 | 87 |
'section': str(section),
|
90 | 88 |
'result': result
|
91 | 89 |
})
|
92 | |
write(json.dumps(results, indent=4, sorted=True))
|
|
90 |
write(json.dumps(results, indent=4, sort_keys=True))
|
93 | 91 |
|
94 | 92 |
if options.dump_entries:
|
95 | 93 |
for document in documents:
|
|
118 | 116 |
if options.output_markdown:
|
119 | 117 |
from feedmark.htmlizer import feedmark_markdownize
|
120 | 118 |
for document in documents:
|
121 | |
s = feedmark_markdownize(document, property_priority_order=options.property_priority_order.split(','))
|
|
119 |
s = feedmark_markdownize(document, schema=schema)
|
122 | 120 |
write(s)
|
123 | 121 |
|
124 | 122 |
if options.output_html:
|
125 | 123 |
from feedmark.htmlizer import feedmark_htmlize
|
126 | 124 |
for document in documents:
|
127 | |
s = feedmark_htmlize(document, property_priority_order=options.property_priority_order.split(','))
|
|
125 |
s = feedmark_htmlize(document, schema=schema)
|
128 | 126 |
write(s)
|
129 | 127 |
|
130 | 128 |
if options.output_html_snippet:
|