duckduckgo / duckduckhack-docs

DuckDuckHack Instant Answer documentation for developers
http://docs.duckduckhack.com
Other
78 stars 75 forks source link

Use Templating #53

Closed GuiltyDolphin closed 8 years ago

GuiltyDolphin commented 8 years ago

GitBook provides a templating system that allows us to specify re-usable variables and sections of markup to be used in multiple places.

I think this would be a good move - we have quite a lot of snippets that are repeated in multiple places throughout the docs; this would make it easier to update all of these at once, as well as reduce any typos copying up.

What's more, if we ever change which system we are using (GitBook, RTD, whatever), it should be relatively easy to move the snippets over.

Thoughts @talsraviv @moollaza?

talsraviv commented 8 years ago

Nice. I didn't know about this feature.

I will keep this in mind as I make edits, perhaps next time we have to update contact URLs or something. @GuiltyDolphin @moollaza any particular place you would start that I'm not thinking about?

GuiltyDolphin commented 8 years ago

@talsraviv A good start might be updating some of the common links to 'variables' (such as the QuackSlack email, repo links etc.) which would help reduce any typos for those.

For example:

In book.json:

    ...
    "variables": {
        "slackEmail": "mailto:QuackSlack@duckduckgo.com?Subject=AddMe"
    }

Then to use it:

...
Why not [contact us on Slack]({{ book.slackEmail }})
...
talsraviv commented 8 years ago

Alright! We're in business:

https://github.com/duckduckgo/duckduckhack-docs/commit/f632fb44eced4cdc6249f7615e6b05972fb07c96

Good find!

GuiltyDolphin commented 8 years ago

@talsraviv Sweet!