Skip to content

Commit

Permalink
remove extra dot
Browse files Browse the repository at this point in the history
  • Loading branch information
lagleki committed Oct 12, 2024
1 parent d62d7bb commit e49d21e
Show file tree
Hide file tree
Showing 10 changed files with 6,965 additions and 1,377 deletions.
4 changes: 4 additions & 0 deletions assets/css/master.css
Original file line number Diff line number Diff line change
Expand Up @@ -859,3 +859,7 @@ screen display
.foreignphrase {
white-space: nowrap;
}

p.monospace {
font-family: monospace;
}
2 changes: 1 addition & 1 deletion chapters/10.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4857,7 +4857,7 @@
<quote>with quantity</quote>
; see
<xref linkend="section-BAI" />) marks as a quantity. Both terms are governed by the tag
<valsi>zu'a</valsi>.
<valsi>zu'a</valsi>
</para>
<para>
It is not necessary to have both an origin point and an explicit magnitude: a termset may have only a single term in it. A less precise version of
Expand Down
1,904 changes: 532 additions & 1,372 deletions chapters/21.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions epub/content.opf.s1
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<meta refines="#isbn-id" property="identifier-type" scheme="onix:codelist5">15</meta>
<dc:language>en-US</dc:language>
<meta property="dcterms:modified">REPLACEDATE</meta>
<meta name="cover" content="media/cover.jpg"/>
<meta name="cover" content="assets/media/cover.jpg"/>
<dc:publisher>The Logical Language Group</dc:publisher>
<dc:description>REPLACEVERSION</dc:description>
<dc:language>en</dc:language>
</metadata>
<manifest>
<item id="cover" href="cover.html" media-type="application/xhtml+xml" />
<item properties="cover-image" id="cover_image" href="media/cover.jpg" media-type="image/jpeg"/>
<item properties="cover-image" id="cover_image" href="assets/media/cover.jpg" media-type="image/jpeg"/>
<item id="toc" properties="nav" href="toc.xhtml" media-type="application/xhtml+xml"/>
<item href="final.css" id="css" media-type="text/css"/>
2 changes: 1 addition & 1 deletion epub/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<div id="cover-image">
<img src="media/cover.jpg" alt="The Complete Lojban Language"/>
<img src="assets/media/cover.jpg" alt="The Complete Lojban Language"/>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion scripts/build_epub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ done

cat $srcdir/content.opf.s3 >>$epubbuilddir/content.opf

cp $srcdir/cover.jpg $epubbuilddir/media/cover.jpg
cp $srcdir/cover.jpg $epubbuilddir/assets/media/cover.jpg
cp $srcdir/cover.html $epubbuilddir/cover.html

rm -f $basedir/build/cll.epub $basedir/build/cll.mobi
Expand Down
53 changes: 53 additions & 0 deletions scripts/yacc/convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import re

def convert_yacc_to_markdown(input_file, output_file):
with open(input_file, 'r') as infile, open(output_file, 'w') as outfile:
in_rules = False
current_rule = ""

outfile.write("# Lojban Grammar\n\n")

for line in infile:
# Retain comments
if line.strip().startswith('/*') or line.strip().startswith('//'):
outfile.write(f"> {line.strip()}\n\n")
continue

# Check if we're in the rules section
if line.strip() == '%%':
in_rules = not in_rules
if in_rules:
outfile.write("## Grammar Rules\n\n")
continue

if in_rules:
# Remove trailing whitespace and newline
line = line.rstrip()

# Start of a new rule
if line and not line.startswith(' ') and not line.startswith('\t'):
if current_rule:
outfile.write(current_rule + "\n```\n\n")
rule_name = line.split(':')[0].strip()
current_rule = f"### {rule_name}\n\n```bnf\n{line}"
# Continuation of current rule
elif line:
# Replace '|' with indented new line
if line.strip().startswith('|'):
current_rule += '\n ' + line.strip()
else:
current_rule += ' ' + line.strip()
else:
# Write non-rule lines as code blocks
if line.strip():
outfile.write(f"```\n{line.strip()}\n```\n\n")

# Write the last rule if there is one
if current_rule:
outfile.write(current_rule + "\n```\n\n")

# Usage
input_file = 'lojban_grammar.y'
output_file = 'lojban_grammar.md'
convert_yacc_to_markdown(input_file, output_file)
print(f"Conversion complete. Output saved to {output_file}")
Loading

0 comments on commit e49d21e

Please sign in to comment.