Code Monkey home page Code Monkey logo

pastek-lang's People

Contributors

bfontaine avatar sagotch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pastek-lang's Issues

Parametrized rule for external rendering

Using the same rule with different parameters could be very useful. A syntax highlighter for instance, taking the language as parameter would need to create as many rule as there is different languages, but only one would be required with parameterized rules.

Something like:

[foo] cmd = "foo --option $1 $2"

%%%foo bar bu
    This is foo, bar is $1 and bu is $2.
%%%

Split parser and compilers

Pastek parser should be a module provided as a library.

Any translater should depends on this library but still being independant.

Also, AST could shipped as another librarie, which would allow to use it for multiple parser. It would allow to use any Markup Language parser to create an AST, and then convert this AST in any target language.

Implement the --config option

The ability of giving the name of a file as toml configuration table would help a lost generating multiple pages without the need to redefine the css and cmd tables (for instance).

Later, pastek should also look for a ~/.pastekconfig file (or another name/location).

Special divisions

Introduce a way to define custom divisions in the document.

<<<???>>>
some pastek here.
<<</>>>

The ??? part could be a identifier, or it may embedded some data for render engines specific use.

Need to think about it.

Verbatim

pastek misses a verbatim mode.

--version flag

It’d be great to be able to use pastek --version to get Pastek’s version for bug reports.

Error while installing pastek.0.5.0 with opam on mac OSX 10.9.5

=-=-= Installing pastek.0.5.0 =-=-=
pastek.0.5.0 Fetching https://github.com/pastek-project/pastek.git#v0.5.0
Copying ~/.opam/repo/pastek/packages/pastek/pastek.0.5.0/files/pastek.install to ~/.opam/4.01.0/build/pastek.0.5.0/
Building pastek.0.5.0:
make build
[ERROR] The compilation of pastek.0.5.0 failed.
Removing pastek.0.5.0.
ocamlfind remove pastek

===== ERROR while installing pastek.0.5.0 =====

opam-version 1.1.2

os darwin

command make build

path /Users/gnukos/.opam/4.01.0/build/pastek.0.5.0

compiler 4.01.0

exit-code 2

env-file /Users/gnukos/.opam/4.01.0/build/pastek.0.5.0/pastek-33078-d0f245.env

stdout-file /Users/gnukos/.opam/4.01.0/build/pastek.0.5.0/pastek-33078-d0f245.out

stderr-file /Users/gnukos/.opam/4.01.0/build/pastek.0.5.0/pastek-33078-d0f245.err

stdout

make -C src/ build

ocamlfind ocamlc -package unix,str,toml -c type.ml

menhir parser.mly

ocamlfind ocamlc -package unix,str,toml -c parser.mli

stderr

File "parser.mli", line 42, characters 60-70:

Error: Unbound type constructor Toml.table

make[1]: *** [parser.cmi] Error 2

make: *** [build] Error 2

The former state can be restored with opam switch import -f "/Users/gnukos/.opam/4.01.0/backup/state-20140910162505.export"
'opam install pastek' failed.

Weird help text formatting

$ pastek --version
pastek version: 2014.03.24
 $ pastek --help
usage: pastek [options] < input > output
  --full-document Generate   a full standalone document.
  --translate-only Translate into target language only (default behavior).
  --no-default-config Do     not use default (~/.pastek/default_config.toml) file.
  --config Use               provided file as configuration file.
  --version Print            pastek version and exit.
  -help                      Display this list of options
  --help                     Display this list of options

The help text is not aligned, e.g.:

--foo Foo    bar

instead of:

--foo    Foo bar

Add comment support

My first idea for comment syntax is

Can you see<< this comment>>?

<<<
This is a comment,
and I like to write it
using lot of lines.
>>>

Usage text doesn’t display the right command name

$ pastek -help
usage: pastek_core [options] < input > output
  --full-document   Generate a full standalone document.
  --translate-only  Translate into target language only (default behavior).
  -help             Display this list of options
  --help            Display this list of options

Notice that it mentions pastek_core even if the command is pastek.

Reference links

Do you plan to support reference links, like Markdown? See example below:

Here is a [link][a-ref] and [another][] with an implicit reference.

[a-ref]: http://example.com/foo
[another]: http://example.com/bar

This is handy when you have long links, for exemple here is an excerpt of a Wikipedia article with expanded links:

**Rambles in Germany and Italy**, in 1840, 1842, and 1843 is a [travel
narrative](https://en.wikipedia.org/wiki/Travel_literature) by the British
[Romantic](https://en.wikipedia.org/wiki/Romanticism) author [Mary
Shelley](https://en.wikipedia.org/wiki/Mary_Shelley). Issued in 1844, it is her
last published work. Published in two volumes, the text describes two European
trips that Mary Shelley took with her son, [Percy Florence
Shelley](https://en.wikipedia.org/wiki/Percy_Florence_Shelley), and several of
his university friends. Mary Shelley had lived in Italy with her husband,
[Percy Bysshe Shelley](https://en.wikipedia.org/wiki/Percy_Bysshe_Shelley),
between 1818 and 1823.

And here is the same excerpt using references:

**Rambles in Germany and Italy**, in 1840, 1842, and 1843 is a [travel
narrative][1] by the British [Romantic][2] author [Mary Shelley][3]. Issued in
1844, it is her last published work. Published in two volumes, the text
describes two European trips that Mary Shelley took with her son, [Percy
Florence Shelley][4], and several of his university friends. Mary Shelley had
lived in Italy with her husband, [Percy Bysshe Shelley][5], between 1818 and
1823.

[1]: https://en.wikipedia.org/wiki/Travel_literature
[2]: https://en.wikipedia.org/wiki/Romanticism
[3]: https://en.wikipedia.org/wiki/Mary_Shelley
[4]: https://en.wikipedia.org/wiki/Percy_Florence_Shelley
[5]: https://en.wikipedia.org/wiki/Percy_Bysshe_Shelley

New table syntax proposal

          Encoded  Mnemonic Argum ent                Action
           Form     Symbol
          ------- --------- ----- ----- ----------------------------------
             0       DAT            B   Initialize location to value B.

             1       MOV      A     B   Move A into location B.

External calls are dangerous

Look at: #14 (comment)

Solution?

  • Ask for confirmation for any call (unless -y option used?)
  • Use a blacklist (filter calls with regexp)
  • Find a way to execute calls with only read rights on anything but stdout (guest user)

UML support (with plantuml ?)

Wouldn't it be nice to be able to define UML diagrams inside pastek files ? The same way it supports Graphviz, it could support an UML modeler, for instance PlantUML.

non-strict mode

Some markdown parsers allow errors in syntax and still process the input, e.g:

$ maruku <<< "aa**" 2>/dev/null

<p>aa**</p>
$ kramdown <<< "aa**"
<p>aa**</p>

Also note that Maruku gives human-friendly errors, e.g.:

$ maruku <<< "aa**"

 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Opening * as last char.
| ---------------------------------------------------------------------------
| aa**EOF
| ---|------------------------------------------------------------------------
|    +--- Byte 3
| Shown bytes [0 to 4] of 4:
| >aa**
|
| At line 2
|       text     |aa**|
|
|
| Elements read in span:
|  -
| Current string:
|   "aa*"
|
|
| Recovering: Treating as literal
+---------------------------------------------------------------------------
!/Users/baptiste/.rvm/gems/ruby-2.0.0-p247/gems/maruku-0.7.1/lib/maruku/input/parse_span.rb:142:in `read_span'
!/Users/baptiste/.rvm/gems/ruby-2.0.0-p247/gems/maruku-0.7.1/lib/maruku/input/parse_span.rb:14:in `parse_span'
!/Users/baptiste/.rvm/gems/ruby-2.0.0-p247/gems/maruku-0.7.1/lib/maruku/input/parse_block.rb:287:in `read_paragraph'
!/Users/baptiste/.rvm/gems/ruby-2.0.0-p247/gems/maruku-0.7.1/lib/maruku/input/parse_block.rb:154:in `read_text_material'
\___________________________________________________________________________


<p>aa**</p>
$ pastek <<< "aa**"
Fatal error: exception Parser.Error

By default, Maruku will process the input even if there’s an error, but it can be told to break on error: maruku --break.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.