Implement new proposal metatags and statuses
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import codecs
|
import codecs
|
||||||
|
from collections import defaultdict
|
||||||
from docutils import io
|
from docutils import io
|
||||||
from docutils.core import (
|
from docutils.core import (
|
||||||
Publisher,
|
Publisher,
|
||||||
@ -31,40 +32,52 @@ SPEC_METATAGS = {
|
|||||||
}
|
}
|
||||||
SPEC_LIST_METATAGS = [
|
SPEC_LIST_METATAGS = [
|
||||||
]
|
]
|
||||||
SPEC_CATEGORY_SORT = {
|
SPEC_CATEGORY_SORT = defaultdict(lambda: 999, {
|
||||||
'Design': 1,
|
'Design': 1,
|
||||||
'Transports': 2,
|
'Transports': 2,
|
||||||
'Protocols': 3,
|
'Protocols': 3,
|
||||||
'': 999,
|
})
|
||||||
}
|
|
||||||
|
|
||||||
PROPOSAL_METATAGS = {
|
PROPOSAL_METATAGS = {
|
||||||
'author': u'I2P devs',
|
'author': u'I2P devs',
|
||||||
'created': None,
|
'created': None,
|
||||||
|
'implementedin': None,
|
||||||
'lastupdated': None,
|
'lastupdated': None,
|
||||||
'status': u'Draft',
|
'status': u'Draft',
|
||||||
'supercededby': None,
|
'supercededby': None,
|
||||||
'supercedes': None,
|
'supercedes': None,
|
||||||
|
'target': None,
|
||||||
'thread': None,
|
'thread': None,
|
||||||
}
|
}
|
||||||
PROPOSAL_LIST_METATAGS = [
|
PROPOSAL_LIST_METATAGS = [
|
||||||
'supercedes',
|
'supercedes',
|
||||||
]
|
]
|
||||||
PROPOSAL_STATUS_SORT = {
|
PROPOSAL_STATUS_SORT = defaultdict(lambda: 999, {
|
||||||
'Draft': 1,
|
'Open': 1,
|
||||||
|
'Accepted': 2,
|
||||||
|
'Finished': 3,
|
||||||
|
'Closed': 90,
|
||||||
'Rejected': 100,
|
'Rejected': 100,
|
||||||
'': 999,
|
'Draft': 10,
|
||||||
}
|
'Needs-Revision': 11,
|
||||||
|
'Dead': 20,
|
||||||
|
'Needs-Research': 15,
|
||||||
|
'Meta': 0,
|
||||||
|
'Reserve': 50,
|
||||||
|
'Informational': 80,
|
||||||
|
})
|
||||||
|
|
||||||
METATAG_LABELS = {
|
METATAG_LABELS = {
|
||||||
'accuratefor': u'Accurate for',
|
'accuratefor': u'Accurate for',
|
||||||
'author': u'Author',
|
'author': u'Author',
|
||||||
'category': u'Category',
|
'category': u'Category',
|
||||||
'created': u'Created',
|
'created': u'Created',
|
||||||
|
'implementedin': u'Implemented in',
|
||||||
'lastupdated': u'Last updated',
|
'lastupdated': u'Last updated',
|
||||||
'status': u'Status',
|
'status': u'Status',
|
||||||
'supercededby': u'Superceded by',
|
'supercededby': u'Superceded by',
|
||||||
'supercedes': u'Supercedes',
|
'supercedes': u'Supercedes',
|
||||||
|
'target': u'Target',
|
||||||
'thread': u'Thread',
|
'thread': u'Thread',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +134,7 @@ def render_rst(directory, name, meta_parser, template):
|
|||||||
content = content.replace('.. raw:: html\n\n', '')
|
content = content.replace('.. raw:: html\n\n', '')
|
||||||
content = content.replace('\n.. [', '\n[')
|
content = content.replace('\n.. [', '\n[')
|
||||||
content = content.replace(']_.', '].')
|
content = content.replace(']_.', '].')
|
||||||
|
content = content.replace(']_,', '],')
|
||||||
content = content.replace(']_', '] ')
|
content = content.replace(']_', '] ')
|
||||||
# Change highlight formatter
|
# Change highlight formatter
|
||||||
content = content.replace('{% highlight', "{% highlight formatter='textspec'")
|
content = content.replace('{% highlight', "{% highlight formatter='textspec'")
|
||||||
|
Reference in New Issue
Block a user