Add New Glossary Page And Developer Search Feature

This commit adds the code necessary to generate a new
en/developre-glossary page with entry pages in the en/glossary/
directory, e.g. en/glossary/51-percent-attack.

The glossary page and the individual term pages feature a JavaScript
search engine (no CGI) for just glossary terms.  This search box has
also been added to the following pages:

    * Developer Documentation (the index page)
    * Developer Guide
    * Developer Reference
    * Developer Examples

The search box requires the following MIT-licensed libraries:

    * JQuery
    * JQuery UI
    * JQuery UI CSS stylesheet

These allow our JS code to be almost trivially simple in js/devsearch.js

This commit adds only code.  Actual glossary entry data will be added in
a subsequent commit.
This commit is contained in:
David A. Harding 2015-03-03 09:11:30 -05:00
parent c2bc8edff3
commit 037cd4553a
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
17 changed files with 609 additions and 11 deletions

View file

@ -0,0 +1,66 @@
---
# This file is licensed under the MIT License (MIT) available on
# http://opensource.org/licenses/MIT.
layout: base
lang: en
---
<link rel="stylesheet" href="/css/jquery-ui.min.css">
{% capture filename %}{{page.filename}}{% endcapture %}
{% include helpers/subhead-links.md %}
<br>
{% capture markdown_content %}
# {{page.required.title_max_40_characters_no_formatting}}
<input id="glossary_term" placeholder="Search the glossary, RPCs, and more">
<div markdown="block" class="notice">
<span markdown="span">This is a technical glossary. Regular users should use the [vocabulary
page](/en/vocabulary).</span>
</div>
## Definition
{% autocrossref %}
{{page.required.summary_max_255_characters_no_formatting}}
{% endautocrossref %}
## Synonyms
{% for synonym in page.required.synonyms_shown_in_glossary_capitalize_first_letter %}
* {{synonym}}
{% endfor %}
{% if page.optional.not_to_be_confused_with_capitalize_first_letter %}
## Not To Be Confused With
{% autocrossref %}
{% for term in page.optional.not_to_be_confused_with_capitalize_first_letter %}
* {{term}}
{% endfor %}
{% endautocrossref %}
{% endif %}
{% if page.optional.links_html_or_markdown_style_capitalize_first_letter %}
## Links
{% for link in page.optional.links_html_or_markdown_style_capitalize_first_letter %}
* {{link}}
{% endfor %}
{% endif %}
{% include references.md %}
{{site.glossary_links}}
{% endcapture %}
{{ markdown_content | markdownify }}{% comment %}Why is this hack necessary? I don't get why this template can't be natively rendered as markdown like the releases template.{% endcomment %}
<script src="/js/jquery-1.11.2.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="/js/devsearch.js"></script>