[doconce] push by h...@simula.no - updates on 2013-07-19 03:58 GMT

1 view
Skip to first unread message

doc...@googlecode.com

unread,
Jul 18, 2013, 11:58:20 PM7/18/13
to docon...@googlegroups.com
Revision: a9fcabe39a8c
Branch: default
Author: "Hans Petter Langtangen <h...@simula.no>"
Date: Thu Jul 18 20:58:04 2013
Log: updates
http://code.google.com/p/doconce/source/detail?r=a9fcabe39a8c

Modified:
/doc/manual/manual.do.txt
/doc/quickref/quickref.do.txt
/lib/doconce/common.py
/lib/doconce/doconce.py
/lib/doconce/html.py
/lib/doconce/latex.py
/lib/doconce/misc.py

=======================================
--- /doc/manual/manual.do.txt Sat Jul 13 00:16:44 2013
+++ /doc/manual/manual.do.txt Thu Jul 18 20:58:04 2013
@@ -471,6 +471,19 @@
with a leading space and a trailing space, comma, semi-colon, or question
mark (but not period!) becomes a link with the web address as link text.)

+=== Mail Addresses ===
+
+Links that launches a mail to a specified address is written as
+ordinary URLs, typically as
+
+!bc
+Send "mail": "mailto:h...@simula.no"
+# Alternative:
+to "`h...@simula.no`": "mailto:h...@simula.no".
+!ec
+which appears as Send "mail": "mailto:h...@simula.no" to
+"`h...@simula.no`": "mailto:h...@simula.no".
+
=== Links to Local Files ===

Links to files ending in `.txt`, `.html`, `.pdf`, `.py`, `.f`,
=======================================
--- /doc/quickref/quickref.do.txt Sat Jul 13 00:16:44 2013
+++ /doc/quickref/quickref.do.txt Thu Jul 18 20:58:04 2013
@@ -429,6 +429,23 @@
rendered nicely anyway.


+===== Hyperlinks =====
+
+Links use either a link text or the raw URL:
+
+!bc
+Here is some "some link text": "http://some.net/address"
+(as in "search google": "http://google.com")
+or just the raw address: URL: "http://google.com".
+
+Links to files typeset in verbatim mode applies backtics:
+"`myfile.py`": "http://some.net/some/place/myfile.py".
+
+Mail addresses works too: send problems to
+"`h...@simula.no`": "mailto:h...@simula.no"
+or just "send mail": "mailto:h...@simula.no".
+!ec
+
===== Figures and Movies =====

Figures and movies have almost equal syntax:
=======================================
--- /lib/doconce/common.py Sat Jul 13 01:34:26 2013
+++ /lib/doconce/common.py Thu Jul 18 20:58:04 2013
@@ -396,8 +396,10 @@
# Consistency check
n = filestr.count(_CODE_BLOCK)
if len(code_blocks) != n:
- print '*** BUG: found %d code block markers for %d initial code
blocks\nAbort!' % (n, len(code_blocks))
+ print '*** BUG: found %d code block markers for %d initial code
blocks' % (n, len(code_blocks))
print 'Possible cause: !bc and !ec inside code blocks - replace by
|bc and |ec'
+ print 'or mismatch of !bt and !et across files in multi-file
documents'
+ print '(run doconce on each file to locate the problem)'
_abort()
n = filestr.count(_MATH_BLOCK)
if len(tex_blocks) != n:
=======================================
--- /lib/doconce/doconce.py Sat Jul 13 05:04:45 2013
+++ /lib/doconce/doconce.py Thu Jul 18 20:58:04 2013
@@ -1692,8 +1692,8 @@
# version < 2.7 warning
print '*** warning: citations may appear in random order unless
you upgrade to Python version 2.7 or 3.1'
if len(citations) > 0 and 'BIBFILE:' not in filestr:
- print '*** error: you have citations but no bibliography
(BIBFILE: ...)'
- _abort()
+ print '*** warning: you have citations but no bibliography
(BIBFILE: ...)'
+ #_abort()
if 'BIBFILE:' in filestr and len(citations) > 0 and \
which('publish') is None:
print '*** error: you have citations and specified a BIBFILE, but'
@@ -1701,6 +1701,13 @@
print ' Download publish from
https://bitbucket.org/logg/publish,'
print ' do cd publish; sudo python setup.py install'
_abort()
+ # Check that citations are correct
+ if pubdata:
+ pubdata_keys = [item['key'] for item in pubdata]
+ for citation in citations:
+ if not citation in pubdata_keys:
+ print '*** error: citation "%s" is not in the BIBFILE' %
citation
+ _abort()

filestr = INDEX_BIB[format](filestr, index, citations, pubfile,
pubdata)
return filestr
=======================================
--- /lib/doconce/html.py Fri Jun 28 09:22:02 2013
+++ /lib/doconce/html.py Thu Jul 18 20:58:04 2013
@@ -806,7 +806,7 @@
# Specify mp4 as first video because on iOS only the first
specified
# video is loaded, and mp4 can play on iOS.
if ext == '':
- print 'Do not specify movie file without extension'
+ print 'do not specify movie file without extension'
if ext in ('.mp4', '.ogg', '.webm'):
# Use HTML video tag
autoplay = 'autoplay' if autoplay else ''
=======================================
--- /lib/doconce/latex.py Sat Jun 29 16:08:22 2013
+++ /lib/doconce/latex.py Thu Jul 18 20:58:04 2013
@@ -682,7 +682,7 @@
application='match'), 'LaTeX', filestr)
#filestr = re.sub('''([^"'`*_A-Za-z0-9-])LaTeX([^"'`*_A-Za-z0-9-])''',
# r'\g<1>{\LaTeX}\g<2>', filestr)
- filestr = re.sub(r'''([^"'`*-])\bLaTeX\b([^"'`*-])''',
+ filestr = re.sub(r'''([^"'`*/-])\bLaTeX\b([^"'`*/-])''',
r'\g<1>{\LaTeX}\g<2>', filestr)
filestr = re.sub(r'''([^"'`*-])\bpdfLaTeX\b([^"'`*-])''',
fix_latex_command_regex(
=======================================
--- /lib/doconce/misc.py Sat Jul 13 00:16:44 2013
+++ /lib/doconce/misc.py Thu Jul 18 20:58:04 2013
@@ -4028,6 +4028,7 @@
#("!bans", "!eans"),
#("!bsol", "!esol"),
#("!bsubex", "!esubex"),
+ #("!bremarks", "!eremarks"),
# Mako
("<%doc>", "</%doc>"),
# hpl tex stuff
@@ -4069,13 +4070,14 @@
# Doconce
(r'"([^"]+?)":\s*"[^"]+?"', r'\g<1>'), # links
(r"^#.*$", "", re.MULTILINE),
- (r"(idx|label|ref)\{.*?\}", ""),
+ (r"(idx|label|ref|cite)\{.*?\}", ""),
(r"={3,}", ""),
(r'`[^ ][^`]*?`', ""),
(r"`[A-Za-z0-9_.]+?`", ""),
(r"^#.*$", "", re.MULTILINE),
(r'"https?://.*?"', ""),
(r'"ftp://.*?"', ""),
+ (r"\b[A-Za-z_0-9/.:]+\.(com|org|net|edu|)\b", ""), # net name
(r'\[[A-Za-z]+:\s+[^\]]*?\]', ''), # inline comment
(r'^\s*file=[A-Za-z_0-9.]+\s*$', '', re.MULTILINE),
(r"^@@@CODE.*$", "", re.MULTILINE),
@@ -4094,6 +4096,7 @@
(r'![be]pop', ''),
(r'![be]warning', ''),
(r'![be]notice', ''),
+ (r'![be]remarks', ''),
# Preprocess
(r"^#.*ifn?def.*$", "", re.MULTILINE),
(r"^#.*else.*$", "", re.MULTILINE),
Reply all
Reply to author
Forward
0 new messages