Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaner conversion of rST files #41

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

conventions:
mkdir -p conventions; \
rst2html5.py \
--no-generator \
--no-datestamp \
--no-section-numbering \
--stylesheet-path=css/conventions.css,css/main.css \
--link-stylesheet \
conventions.rst \
rst2html5 \
--template=_template.html \
--stylesheet=css/conventions.css \
--stylesheet=css/main.css \
conventions.rst | \
python _html5_postprocessor.py > \
conventions/index.html
21 changes: 21 additions & 0 deletions _html5_postprocessor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys

sentinels = ('AUTO-REMOVED DUMMY', 'auto-removed-dummy')

depth = 0
for line in sys.stdin:
# only write lines that don't have our sentinel values
keep = True
for sentinel in sentinels:
if sentinel in line:
keep = False
break
# the depth check is hackish, it relies on the prior knowledge that we're
# only putting in one top-level dummy heading (it won't handle mid-level
# dummies)
if '<section' in line:
depth += 1
elif '</section' in line:
depth -= 1
if keep and depth > 0:
sys.stdout.write(line)
1 change: 1 addition & 0 deletions _template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{body}
15 changes: 11 additions & 4 deletions conventions.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
==============================
PHOIBLE notational conventions
==============================

.. role:: ipa

.. role:: dia
Expand All @@ -11,8 +7,19 @@ PHOIBLE notational conventions
.. role:: iso


================================
AUTO-REMOVED DUMMY HEADING LEVEL
================================

AUTO-REMOVED DUMMY PARAGRAPH


PHOIBLE notational conventions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In order to preserve distinctions both within and across language descriptions, additions to the approved International Phonetic Alphabet (IPA) glyph set were needed; wherever possible these were drawn from the `extIPA symbols for disordered speech`_. This page describes our additions to the IPA glyph set, and also describes any idiosyncracies in our interpretation and usage of approved IPA glyphs, and conventions regarding glyph ordering. When we use the terms “official IPA”, “approved IPA glyphs”, or just “IPA” we are referring to `the 2005 update of the full chart`_ unless otherwise indicated.


Similar-looking glyphs
======================

Expand Down
Loading