Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional doc for templates and themes #50

Merged
merged 3 commits into from
Nov 8, 2016

Conversation

gsechaud
Copy link
Contributor

@gsechaud gsechaud commented Nov 2, 2016

Indicate how to deal with templates and themes and what are the possibilities with them.

Copy link
Contributor

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

@@ -20,7 +20,6 @@ import com.lightbend.paradox.tree.Tree.{ Forest, Location }
import com.lightbend.paradox.template.PageTemplate
import java.io.File
import java.net.URI
import java.nio.file.{ Path, Paths }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import java.nio.file.{ Path => NioPath , Paths => NioPaths }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably split this commit.

@@ -1,5 +1,4 @@
Linking
-------
# Linking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change Callouts to H2 instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eed3si9n Is the reason to use H2 for top-level titles to support PDFs output (#14)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Maybe because I'm using Pamflet that can generate combined pages and PDF, I think of the whole doc as one big markdown file.

```markdown
## myTitle
```
and similarly for `=` and `#`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove description of headers. And mention that the first header becomes the title of the page.

@@ -1,5 +1,5 @@
Snippet inclusion
-----------------
=================
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo

@@ -1,21 +1,32 @@
[st]: http://www.stringtemplate.org/

Templating
----------
==========
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo


The `layout` property allows to specify the layout we want to be used for this particular page. The layouts are placed by default in the `target/paradox/theme` folder, but you can create one in `src/main/paradox/_template` folder as a string template file (.st).
The `layout` property allows to specify the template we want to be used for this particular page. The templates are generated by default in paradox in the `target/paradox/theme` folder, but you can create one in `src/main/paradox/_template` folder as a string template file (.st).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change for the first sentence:
The layout of the page is determined by default by a template called page.st. Using layout property, we can change the layout template to something else for this particular page.

@@ -43,9 +54,15 @@ layout: templateName
*/
```

where `templateName` is the name of a template, more precisely the `templateName.st` file, which could either be a predefined template, or a created one in the `src/main/paradox/_template` folder.
where `templateName` is the name of a template, more precisely the `templateName.st` file, which could either be a predefined template, or a created one in the `src/main/paradox/_template` folder. The default templates generated by paradox depends on the theme used, see [this](themes.md) for more info about themes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use @ref?

Theming
=======

Paradox uses "theming" to generate its target files. Combined with templates within it, themes can produce a global styling of the site generated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A theme is a collection of templates and other resources like css and image files that can be distributed as a web jar. Using this mechanism, multiple Paradox sites can have consistent look and feel.

*/
```

## How to use themes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this section, just explain how to use external themes or local templates.

```

considering you have previously created a template with the name `myDefault.st`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here make a new section for creating a new theme.

@eed3si9n eed3si9n merged commit d2f32da into lightbend:master Nov 8, 2016
@gsechaud gsechaud deleted the docTheme branch January 10, 2017 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants