2017 © Pedro Peláez
 

library carta

Simple way to transform different markup languages to HTML.

image

gentle/carta

Simple way to transform different markup languages to HTML.

  • Sunday, July 20, 2014
  • by vimishor
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Carta library Build Status Coverage Status

Carta offers a simple way to transform different markup languages to HTML (the irony). For the moment it supports Markdown and reStructuredText., (*1)

Example

$carta = new \Gentle\Carta\Carta(
    '/path/to/markdown/files',
    new \Gentle\Carta\Parser\MarkdownParser()
);

# parse a single page and get content
$carta->page('subdir/file.md')->getContent();

# load all files from directory and get each page title
foreach ($carta->chapter('subdir/')->getPages() as $page) {
    echo $page->getMetaTag('title');
}

Page metadata

You can specify custom metadata inside each source file, by using the format key: value at the beginning of the file, surrounded by three or more dashes., (*2)

Example:, (*3)

```yaml, (*4)


title: "The page title" description: "Page description" tags: ["tag1", "tag2"], (*5)


```, (*6)

This will result in the following usage:, (*7)

php // [...] $page->getMetaTag('title'); // will return: The page title $page->getMetaTag('description'); // will return: Page description $page->getMetaTag('tags'); // will return: array('tag1', 'tag2'), (*8)

There are no restrictions in place for what meta keys you can use, so you can define any key you want., (*9)

Glossary

The following terms are used inside Carta library:, (*10)

  • Page: refers to a single source file. ( .md, .rst, etc )
  • Chapter: refers to a directory which contains multiple "Pages".

License

Carta is licensed under the MIT License - see the LICENSE file for details, (*11)

The Versions

20/07 2014

dev-develop

dev-develop http://www.gentle.ro

Simple way to transform different markup languages to HTML.

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown markup restructuredtext