Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Pillar: One Format to Rule them All

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
Ocean Update
Ocean Update
Wird geladen in …3
×

Hier ansehen

1 von 49 Anzeige

Pillar: One Format to Rule them All

Herunterladen, um offline zu lesen

Pillar: One Format to Rule them All

First Name: Cyril
Last Name: Ferlicot
Type: Talk

Video: https://www.youtube.com/watch?v=3EdSENvCmjg


Abstract: Pillar is a markup syntax and associated tools to write and
generate documentation and books. Pillar is currently used to write the
Enterprise Pharo book, the Updated Pharo by Example book, and many other
texts. Pillar has many features:

- simple markup syntax with references, tables, pictures, captions...;
- export to HTML, LaTeX, Markdown and Pillar itself;
- customization of the export through a dedicated STON configuration file;
- support of templates using the Mustache templating engine;
- syntax-highlighting of generated code blocks;
- configurable numbering of section titles and figures;
- ...

Bio: Cyril Ferlicot-Delbecque is a student at the French University of Lille 1. He follows a course to get a Master’s degree in Business Informatics. He is currently doing an internship in the RMoD research group at INRIA Lille and he is working on Pillar.

Damien Cassou received his PhD degree in Computer Science from the
University of Bordeaux, France. He is working as associate professor
(maître de conférences) at the University of Lille, France, and is a
member of the RMod research group (Inria, CRIStAL). He is currently working on dynamic programming languages (most notably around traits and modules) and software engineering (mainly tools for developers). Damien has co-organized many events (including ECOOP'14 and several ESUGs), wrote several books, and is an active member of the Smalltalk and Emacs-Lisp communities.

Pillar: One Format to Rule them All

First Name: Cyril
Last Name: Ferlicot
Type: Talk

Video: https://www.youtube.com/watch?v=3EdSENvCmjg


Abstract: Pillar is a markup syntax and associated tools to write and
generate documentation and books. Pillar is currently used to write the
Enterprise Pharo book, the Updated Pharo by Example book, and many other
texts. Pillar has many features:

- simple markup syntax with references, tables, pictures, captions...;
- export to HTML, LaTeX, Markdown and Pillar itself;
- customization of the export through a dedicated STON configuration file;
- support of templates using the Mustache templating engine;
- syntax-highlighting of generated code blocks;
- configurable numbering of section titles and figures;
- ...

Bio: Cyril Ferlicot-Delbecque is a student at the French University of Lille 1. He follows a course to get a Master’s degree in Business Informatics. He is currently doing an internship in the RMoD research group at INRIA Lille and he is working on Pillar.

Damien Cassou received his PhD degree in Computer Science from the
University of Bordeaux, France. He is working as associate professor
(maître de conférences) at the University of Lille, France, and is a
member of the RMod research group (Inria, CRIStAL). He is currently working on dynamic programming languages (most notably around traits and modules) and software engineering (mainly tools for developers). Damien has co-organized many events (including ECOOP'14 and several ESUGs), wrote several books, and is an active member of the Smalltalk and Emacs-Lisp communities.

Anzeige
Anzeige

Weitere Verwandte Inhalte

Weitere von ESUG (20)

Aktuellste (20)

Anzeige

Pillar: One Format to Rule them All

  1. 1. Pillar One Format to Rule Them All! Cyril Ferlicot-Delbecque, Damien Cassou http://www.smalltalkhub.com/#!/~Pier/Pillar 1
  2. 2. What is Pillar ? What is Pillar ? 2
  3. 3. Problem We want more documentation We want many formats pdf html epub We do not want to rewrite everything We want it simple If you want them to RTFM, make a better FM. What is Pillar ? 3
  4. 4. Currently LaTeX Complicated Hard to find an error Hard to convert in HTML Markdown Incomplete Incompatible implementation What is Pillar ? 4
  5. 5. Currently LaTeX Complicated Hard to find an error Hard to convert in HTML Markdown Incomplete Incompatible implementations What is Pillar ? 5
  6. 6. Our Solution: Pillar One input, many outputs HTML LaTeX Text Markdown Textual syntax No need for a specific editor !Example This is an example of a Pillar file. *Link>http://www.smalltalkhub.com/* - Unordered Item - Unordered Item # Ordered Item # Ordered Item |!Language |!Coolness |Smalltalk | Hypra cool |Java | baaad + Figure !>file://path.png|width=80+ What is Pillar ? 6
  7. 7. Our Solution: Pillar Extracted from Pier Now Pier needs Pillar !Example This is an example of a Pillar file. *Link>http://www.smalltalkhub.com/* - Unordered Item - Unordered Item # Ordered Item # Ordered Item |!Language |!Coolness |Smalltalk | Hypra cool |Java | baaad + Figure !>file://path.png|width=80+ What is Pillar ? 7
  8. 8. Current Uses Current Uses 8
  9. 9. PillarHub by Mike Filonov. Current Uses 9
  10. 10. http://pillarhub.pharocloud.com/ Current Uses http://pillarhub.pharocloud.com/ 10
  11. 11. Books Current Uses http://pillarhub.pharocloud.com/ 11
  12. 12. Current Books Updated Pharo by Example Pharo for the Enterprise Current Uses http://pillarhub.pharocloud.com/ 12
  13. 13. Presentations Current Uses http://pillarhub.pharocloud.com/ 13
  14. 14. Presentations This presentation itself is written in Pillar. Current Uses http://pillarhub.pharocloud.com/ 14
  15. 15. Ecstatic: Static Websites !Ecstatic Ecstatic is a static web-site generator engine written entirely in +Pharo>http://www.pharo.org+. The Ecstatic engine generates html from the markup language Pillar. Ecstatic is based on the following principles: - Ease of use - Fast feedback - Extensible +Getting started>getting_started.pillar+ Current Uses http://pillarhub.pharocloud.com/ 15
  16. 16. Ecstatic: Static Websites Current Uses http://pillarhub.pharocloud.com/ 16
  17. 17. Ecstatic: Static Websites Created by Guillermo Polito and Stephane Ducasse Generate static website with Pillar Many templates Examples Ecstatic (guillep.github.io/ecstatic) Current Uses http://pillarhub.pharocloud.com/ 17
  18. 18. Ecstatic: Static Websites Created by Guillermo Polito and Stephane Ducasse Generate static website with Pillar Many templates Examples Ecstatic (guillep.github.io/ecstatic) DBXTalk (guillep.github.io/DBXTalk) Current Uses http://pillarhub.pharocloud.com/ 18
  19. 19. Ecstatic: Static Websites Created by Guillermo Polito and Stephane Ducasse Generate static website with Pillar Many templates Examples Ecstatic (guillep.github.io/ecstatic) DBXTalk (guillep.github.io/DBXTalk) Personal pages as tinchodias.github.io Current Uses http://pillarhub.pharocloud.com/ 19
  20. 20. http://guillep.github.io/ecstatic Current Uses http://guillep.github.io/ecstatic 20
  21. 21. Documentation renderer Prototype by Kasper Osterbye Current Uses http://guillep.github.io/ecstatic 21
  22. 22. Begin a Documentation with Pillar Begin a Documentation with Pillar 22
  23. 23. Simple Example 1 https://raw.githubusercontent.com/pillar-markup/book-skeleton/master/ download.sh 2 echo "!Hello World" > Example.pillar 3 ./pillar export - -to=html - -outputFile=Example.html Example.pillar Begin a Documentation with Pillar 23
  24. 24. Use Your Own Templates One default template by exporter Possibility to create your own template Possibility to use meta-data in the template ’<!DOCTYPE html> <html lang="en"> <head> <title>{{{title}}}</title> <link rel="stylesheet" href="http://yandex.st/ highlightjs/8.0/styles/default.min.css"> </head> <body> <h1>{{{subtitle}}}</h1> <div class="container"> {{{content}}} </div> </body> </html>’ Begin a Documentation with Pillar 24
  25. 25. Configuration: pillar.conf Configure your exports with a simple file STON syntax Can contain Export configuration Sub configurations Meta-data ’{ "inputFiles": [ "Pillar.pillar" ], "outputFile": "Pillar.tex", "author":"Damien Cassou, Cyril Ferlicot", "title": "Pillar", "configurations": { "beamer":{ "template" : "slides.beamer.template", } "beamer2":{ "outputType": #beamer, "template":"slides.beamer2.template" } } }’ Begin a Documentation with Pillar 25
  26. 26. Text Editor Plugins You can find Pillar plugin for: Emacs Vim TextMate Atom Begin a Documentation with Pillar 26
  27. 27. Text Editor Plugins You can find Pillar plugin for: Emacs Vim TextMate Atom Begin a Documentation with Pillar 27
  28. 28. How Pillar Works How Pillar Works 28
  29. 29. Parse .Pillar PRDocumentParser PRDocument PRHeader PRText PRParagraph PRText PRFigure Example.pillar !Hello World I am an example +>file://figures/fig.png+ How Pillar Works 29
  30. 30. Transformation PRDocument PRHeader PRText PRParagraph PRText PRFigure PRSectionTransformer PRDocument PRHeader PRText PRSection PRParagraph PRText PRFigure Example.pillar !Hello World I am an example +>file://figures/fig.png+ How Pillar Works 30
  31. 31. Export PRDocument PRHeader PRText PRSection PRParagraph PRText PRFigure PRLaTeXWriter PRHTMLWriter PRTextWriter .pdf .html .txt pdflatex .tex How Pillar Works 31
  32. 32. Phases System PRCreationPhase PRParsingPhase PRTransformingPhase transformerScriptEvaluator transformerSection PRExportingPhase nil A collection of input files A collection of PRDocuments A collection of transformed PRDocuments Exported files How Pillar Works 32
  33. 33. Easy Extension Easy Extension 33
  34. 34. Adding an Exporter Write a format from a document model Just write a visitor for the document Check your exporter with tests Easy Extension 34
  35. 35. Adding an Annotation Syntax extension point Can take parameters Describe your parameters with Magritte Work well with transformers Examples: Include a Pillar file ${inputFile:folder/file.pillar}$ Define boundaries of a Slide ${slide:title=title of the slide}$ Divide into columns ${column:width=50}$ Easy Extension 35
  36. 36. Adding an Annotation PRAbstractAnnotation subclass: #MyNewAnnotation instanceVariableNames: ’’ classVariableNames: ’’ category: ’Pillar−Model−Document’ Easy Extension 36
  37. 37. Adding an Annotation PRAbstractAnnotation subclass: #MyNewAnnotation instanceVariableNames: ’’ classVariableNames: ’’ category: ’Pillar−Model−Document’ MyNewAnnotation class>>#tag ^ #myTag Easy Extension 37
  38. 38. Adding an Annotation PRAbstractAnnotation subclass: #MyNewAnnotation instanceVariableNames: ’’ classVariableNames: ’’ category: ’Pillar−Model−Document’ MyNewAnnotation class>>#tag ^ #myTag MyNewAnnotation>>#descriptionWidth <magritteDescription> ^ MANumberDescription new accessor: #width; required: true; min: 0 max: 100; yourself Easy Extension 38
  39. 39. Adding a Transformer Transform a document Visit the document to transform it Basic transformers structure exist Easy Extension 39
  40. 40. Adding a Transformer PRNodeTransformer subclass: #PRFileInclusion instanceVariableNames: ’’ classVariableNames: ’’ category: ’Pillar−Model−Transformer’ Easy Extension 40
  41. 41. Adding a Transformer PRNodeTransformer subclass: #PRFileInclusion instanceVariableNames: ’’ classVariableNames: ’’ category: ’Pillar−Model−Transformer’ PRFileInclusion>>#visitInputFileAnnotation: anInputFileAnnotation "I load the file and if the file exist I replace the node of the annotation by the content of the file." | file | file := anInputFileAnnotation fileWithConfiguration: self configuration. file exists ifTrue: [ self replace: (anInputFileAnnotation parseFile: file withConfiguration: self configuration) children ] ifFalse: [ anInputFileAnnotation errorFileNotFound: file ] Easy Extension 41
  42. 42. Adding a Transformer You can: Define a priority Define a keyword to disable a transformer Generate documentation of the transformer PRTransformingPhase>>#transformerInputFileOn: aCollection <pillarTransformer: 1 key: ’fileInclusion’ documentation: ’I visit a document and transform an ==inputFile== annotation into the content of the file.’> aCollection do: [ :each | PRFileInclusion new configuration: self configuration; start: each ] Easy Extension 42
  43. 43. Conclusion Conclusion 43
  44. 44. Conclusion One Format to Rule Them All Easy to extends Future Work Improve the Pharo renderer An Epub and a DocBook exporter would be great. We have a large TODO list Conclusion 44
  45. 45. Annexes Annexes 45
  46. 46. Partial Diagram of Pillar PRCocoonConfiguration exportPRDocument PRDocumentParser parse(aFile):aDocument PRDocumentItem acceptVisitor(aVisitor) PRHeader PRParagraph PRText PRDocumentWriter write(aDocument) PRVisitor visit(aDocument) visitHeader(aHeader) visitParagraph(aParagraph) visitText(aText) PRHTMLWriter * PRLaTeXWriter PREmptyParagraph PRPhaser export() PRPhase actionOn(input):output transform(input):output n Annexes 46
  47. 47. Sequence Diagram a PRHTMLWriter a PRHeader a PRText a PRScript accept: self start: aDocument visit: aDocument visitDocument: aDocument visitDocumentGroup: aDocument visitHeader: self accept: self Ici le titre commence à s'écrire. visitText: self Ici le contenu du titre s'écrit Puis il écrit la fin du titre accept: self visitScript: self Ici le script s'écrit a PRDocument children PRItem Collection Annexes 47
  48. 48. Moose analysis of Pillar Annexes 48
  49. 49. Non Exhaustive Syntax of Pillar Annexes 49

×