maruku 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/docs/maruku.md +96 -18
- data/lib/maruku/to_latex.rb +1 -0
- data/lib/maruku/to_latex_strings.rb +3 -3
- metadata +2 -2
data/docs/maruku.md
CHANGED
@@ -116,7 +116,7 @@ There are two command-line programs installed: `maruku` and `marutex`.
|
|
116
116
|
|
117
117
|
$ maruku file.md # creates file.html
|
118
118
|
|
119
|
-
* `marutex` converts Markdown to
|
119
|
+
* `marutex` converts Markdown to LaTeX, then calls `pdflatex` to
|
120
120
|
transform to PDF:
|
121
121
|
|
122
122
|
$ marutex file.md # creates file.tex and file.pdf
|
@@ -235,6 +235,7 @@ When creating the document through
|
|
235
235
|
|
236
236
|
the title and stylesheet are added as expected.
|
237
237
|
|
238
|
+
Meta-data keys are assumed to be case-insensitive.
|
238
239
|
|
239
240
|
### Meta-data for elements ###
|
240
241
|
|
@@ -288,9 +289,6 @@ Also, if the value is not present, it defaults to `true`:
|
|
288
289
|
|
289
290
|
This paragraph has the attribute `test` set to `true`.
|
290
291
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
292
|
* * *
|
295
293
|
|
296
294
|
|
@@ -298,6 +296,8 @@ Also, if the value is not present, it defaults to `true`:
|
|
298
296
|
|
299
297
|
### List of meta-data ### {#metalist}
|
300
298
|
|
299
|
+
[listings]: http://www.ctan.org/tex-archive/macros/latex/contrib/listings/
|
300
|
+
|
301
301
|
**`title`, `subject`**
|
302
302
|
: (document) Sets the title of the document (HTML: used in the `TITLE` element).
|
303
303
|
|
@@ -308,10 +308,10 @@ Also, if the value is not present, it defaults to `true`:
|
|
308
308
|
: (document, HTML) Url of stylesheet.
|
309
309
|
|
310
310
|
**`html_use_syntax`**
|
311
|
-
: (document, HTML) If set, use the [`syntax` library][syntax] to add source highlighting.
|
311
|
+
: (document, HTML) If set, use the [Ruby `syntax` library][syntax] to add source highlighting.
|
312
312
|
|
313
313
|
**`latex_use_listings`**
|
314
|
-
: (document, LaTeX) If set, use fancy `
|
314
|
+
: (document, LaTeX) If set, use the fancy [`listings` package][listings] for better displaying code blocks.
|
315
315
|
|
316
316
|
If not set, use standard `verbatim` environment.
|
317
317
|
|
@@ -319,9 +319,13 @@ Also, if the value is not present, it defaults to `true`:
|
|
319
319
|
: (any block object, HTML) Standard CSS attributes are copied.
|
320
320
|
|
321
321
|
**`lang`**
|
322
|
-
: (code blocks) Name of programming language (`ruby`) for syntax highlighting
|
322
|
+
: (code blocks) Name of programming language (`ruby`) for syntax highlighting.
|
323
323
|
|
324
324
|
Default for this is `code_lang` in document.
|
325
|
+
|
326
|
+
Syntax highlighting is delegated to the [`syntax` library][syntax] for
|
327
|
+
HTML output and to the [`listings` package][listings] for LaTeX output.
|
328
|
+
|
325
329
|
|
326
330
|
**`code_show_spaces`**
|
327
331
|
: Shows tabs and newlines (default is read in the document object).
|
@@ -415,7 +419,13 @@ TODO list
|
|
415
419
|
|
416
420
|
|
417
421
|
* Export to HTML
|
418
|
-
|
422
|
+
1. Add `-split` options to `maruku` that splits the document over multiple
|
423
|
+
pages.
|
424
|
+
|
425
|
+
This should require the possibility of specifying a template for navigational
|
426
|
+
elements. Investigate template engine.
|
427
|
+
|
428
|
+
2. Include RubyPants
|
419
429
|
|
420
430
|
* Export to PDF
|
421
431
|
* support for images
|
@@ -434,23 +444,91 @@ I would love to have an equivalent in Ruby.
|
|
434
444
|
[Pandoc]: http://sophos.berkeley.edu/macfarlane/pandoc/
|
435
445
|
[MultiMarkdown]: http://fletcher.freeshell.org/wiki/MultiMarkdown
|
436
446
|
|
437
|
-
### Syntax improvements ### {#future-syntax}
|
438
447
|
|
439
|
-
|
448
|
+
### A syntax for specifying meta-data for span-level elements ###
|
449
|
+
|
450
|
+
Maybe something like this:
|
451
|
+
|
452
|
+
This is a paragraph. The second line of this paragraph has
|
453
|
+
the last element {with meta data}@ class: important_span
|
454
|
+
and the paragraph continues...
|
455
|
+
|
456
|
+
So the idea is:
|
457
|
+
|
458
|
+
* Only elements at the end of the line can have meta data.
|
459
|
+
* Syntax is:
|
460
|
+
1. Opening brace `{`.
|
461
|
+
2. Any string that does not contain the sequence `}@`.
|
462
|
+
3. Closing brace and at-symbol `}@`.
|
463
|
+
4 Attributes specification like the block-level metadata.
|
464
|
+
|
465
|
+
Other examples:
|
466
|
+
|
467
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing
|
468
|
+
elit. Donec sit amet sapien vitae augue {interdum hendrerit.}@ id: special
|
469
|
+
Maecenas tempor ultrices nisl. Praesent laoreet tortor sit
|
470
|
+
amet est. Praesent in nisl eu libero sodales bibendum.
|
471
|
+
|
472
|
+
Or, we could allow metadata specified **after the text**.
|
473
|
+
In the following, three fragments are marked as "special",
|
474
|
+
and, after their containing block-level elements, their
|
475
|
+
attributes are set:
|
476
|
+
|
477
|
+
Lorem ipsum dolor sit @{amet}, consectetuer adipiscing
|
478
|
+
elit. Donec sit amet sapien vitae augue @{interdum hendrerit.}
|
479
|
+
Maecenas tempor ultrices nisl. @{Praesent laoreet tortor sit
|
480
|
+
amet est.} Praesent in nisl eu libero sodales bibendum.
|
481
|
+
|
482
|
+
@{1} id: amet
|
483
|
+
@{2} style: "font-style: bold"
|
484
|
+
@{3} class: warning
|
485
|
+
|
486
|
+
We can be much liberal in the syntax. For example, instead of
|
487
|
+
numeric references to the part in the text, we could write:
|
488
|
+
|
489
|
+
Lorem ipsum dolor sit @{amet}, consectetuer adipiscing
|
490
|
+
elit. Donec sit amet sapien vitae augue @{interdum hendrerit.}
|
491
|
+
Maecenas tempor ultrices nisl. @{Praesent laoreet tortor sit
|
492
|
+
amet est.} Praesent in nisl eu libero sodales bibendum.
|
493
|
+
|
494
|
+
@{amet} id: amet
|
495
|
+
@{interdum ...} style: "font-style: bold"
|
496
|
+
@{Praesent ...} class: warning
|
497
|
+
|
498
|
+
with `...` acting as a wildcard, to match a long phrase (`{ Praesent laoreet tortor sit amet est.}`) without specifying the full text.
|
499
|
+
|
500
|
+
I feel this is very readable and not intrusive. But then again,
|
501
|
+
subjective tastes vary. Let me know of any comments and suggestions.
|
502
|
+
I want to wait for feedback before implementing this.
|
503
|
+
|
504
|
+
### A syntax for commenting parts of the document ###
|
505
|
+
|
506
|
+
This is a paragraph
|
507
|
+
% This is a comment
|
508
|
+
|
509
|
+
Or `%` on a line by itself comments the following block:
|
510
|
+
|
511
|
+
% The following paragraph is ignored
|
512
|
+
|
513
|
+
%
|
514
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing
|
515
|
+
elit. Donec sit amet sapien vitae augue interdum hendrerit.
|
516
|
+
Maecenas tempor ultrices nisl. Praesent laoreet tortor sit
|
517
|
+
amet est. Praesent in nisl eu libero sodales bibendum.
|
518
|
+
|
519
|
+
This paragraph is not ignored.
|
440
520
|
|
441
|
-
|
521
|
+
### A syntax for adding math ###
|
442
522
|
|
443
|
-
|
444
|
-
% This is a comment
|
523
|
+
Something inspired from LaTeX should be familiar to all:
|
445
524
|
|
446
|
-
|
525
|
+
This is inline math: $\alpha$
|
447
526
|
|
448
|
-
This is inline math: $\alpha$
|
449
527
|
|
450
|
-
|
528
|
+
This is an equation with label:
|
451
529
|
|
452
|
-
|
530
|
+
$ \alpha = \beta + \gamma $ (eq:1)
|
453
531
|
|
454
|
-
|
532
|
+
This is a reference to equation: please see (eq:1)
|
455
533
|
|
456
534
|
|
data/lib/maruku/to_latex.rb
CHANGED
@@ -20,9 +20,9 @@ class String
|
|
20
20
|
|
21
21
|
# other things that are good on the eyes
|
22
22
|
OtherGoodies = {
|
23
|
-
|
24
|
-
'HTML' => '\\textsc{html}',
|
25
|
-
'PDF' => '\\textsc{pdf}'
|
23
|
+
/(\s)LaTeX/ => '\1\\LaTeX\\xspace', # XXX not if already \latex
|
24
|
+
'HTML' => '\\textsc{html}\\xspace',
|
25
|
+
'PDF' => '\\textsc{pdf}\\xspace'
|
26
26
|
}
|
27
27
|
|
28
28
|
def String.convert_entities(s)
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: maruku
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2006-12-
|
6
|
+
version: 0.2.6
|
7
|
+
date: 2006-12-27 00:00:00 +01:00
|
8
8
|
summary: A Markdown interpreter in Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|