jekyll-theme-open-project 1.1.24 → 1.1.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8fce901d2f3924596242e699f0e9719a86a9cb071a3e854489475ac5c650529
4
- data.tar.gz: 8fb7ff15b83a37d4c6faf071bce7d30cc8be6b2ce6535550f1ee39d1ea23e07b
3
+ metadata.gz: e09f5fa2c2fd4362589ab6084c27892a7a9074a4bca12cf5eee38724552891da
4
+ data.tar.gz: 01de902102f9fdf21af5c09b0622825b813cdb4a3c5625ac8ee18d8cba58f369
5
5
  SHA512:
6
- metadata.gz: f4600c9320dc30fea748bc24ddf95ef2b9db966d6c933088669716fa36edd3df8c244a4bc51f8a34a26fd0f90fbc36348faa186de4c938597e2c4fd92f654d57
7
- data.tar.gz: cc18435994f4d649b31febddc894ad7b1a92ad9bcc68884c444fa53e5deb22248b237bca3dfe81dec7a6125dbffe2ac51edc89574c4fbb7caa61d13e37c08969
6
+ metadata.gz: faf6286e377c24a56a813e202dbf31fb423f97a446123c35aa75721eeb7fb7c3b00cf427b8891dabb60cc9b27956713d45f871017c89584cd340da8d3cecb5bd
7
+ data.tar.gz: c92a53183417eaa8496cf4c0cdaee5d7fc9d8dfe85082b1778414c3958bf2e6f9f64d38812950fa2be9420509a67ffe9e38d9249d08a707103eff23bdb7dec28
data/README.md CHANGED
@@ -275,6 +275,15 @@ home_url: <URL to standalone project site>
275
275
  # (see hub site configuration for tag namespace setup).
276
276
  # Avoid long namespace/tag combos as they can overflow item’s card widget.
277
277
  tags: [Ruby, Python, RFC, "<some_namespace_id>:<appropriate_tag>"]
278
+
279
+ # NOTE: Must match corresponding hub site’s configuration entry.
280
+ tag_namespaces:
281
+ software:
282
+ namespace_id: "Human-readable namespace name"
283
+ # E.g.:
284
+ # writtenin: "Written in"
285
+ specs:
286
+ namespace_id: "Human-readable namespace name"
278
287
  ```
279
288
 
280
289
  ### Project index page
@@ -459,9 +468,9 @@ source_url: https://example.com/spec-source-markup
459
468
  # Required.
460
469
  ```
461
470
 
462
- ### Documentation for specs and software
471
+ ### Documentation for software, and specification contents
463
472
 
464
- Documentation contents for software should be kept in software
473
+ **Software docs** should be kept in software
465
474
  package’s own repository, under a directory such as `docs/`.
466
475
  Inside that directory, place a file called `navigation.md` containing
467
476
  only frontmatter, in format like this:
@@ -477,12 +486,37 @@ sections:
477
486
  - basic
478
487
  ```
479
488
 
480
- In the same directory, place the required document pages—in this case, overview.md,
481
- installation.md, and basic.md. Each document page is required to contain
489
+ In the same directory, place the required document pages—in this case, `overview.md`,
490
+ `installation.md`, and `basic.md`. Each document page is required to contain
482
491
  standard YAML frontmatter with at least `title` specified.
483
492
 
484
- During project site build, Jekyll will pull docs for software products
485
- that are hosted under that project site.
493
+ For **specification contents** to be built, provide configuration
494
+ and navigation in YAML frontmatter of corresponding `_specs/<specname>.adoc` file,
495
+ following this example:
496
+
497
+ ```yaml
498
+ spec_source:
499
+ git_repo_url: https://github.com/<user>/<repo>
500
+ git_repo_subtree: images
501
+ build:
502
+ engine: png_diagrams
503
+
504
+ navigation:
505
+ sections:
506
+ - name: Model diagrams
507
+ items:
508
+ - title: "CSAND Normal Document"
509
+ path: "Csand_NormalDocument"
510
+ description: ""
511
+ ignore_missing: yes
512
+ ```
513
+
514
+ For now, only the `png_diagrams` engine is supported, with Metanorma-based
515
+ project build engine to come.
516
+
517
+ During project site build, Jekyll pulls software docs or spec contents
518
+ that are hosted under that project site. For spec contents, Jekyll runs
519
+ a build, if specified.
486
520
 
487
521
  ### Symbol
488
522
 
@@ -53,7 +53,7 @@
53
53
  </p>
54
54
 
55
55
  <footer class="meta">
56
- {% include tag-list.html tags=item.tags %}
56
+ {% include tag-list.html tags=item.tags item_type="software" %}
57
57
 
58
58
  {% if item.last_update %}
59
59
  <section class="last-update">
@@ -104,7 +104,7 @@
104
104
  </p>
105
105
 
106
106
  <footer class="meta">
107
- {% include tag-list.html tags=item.tags %}
107
+ {% include tag-list.html tags=item.tags item_type="specs" %}
108
108
 
109
109
  {% if item.last_update %}
110
110
  <section class="last-update">
@@ -5,11 +5,15 @@
5
5
  {% assign is_docs_landing = false %}
6
6
  {% endif %}
7
7
 
8
- <section class="documentation {% if is_docs_landing %}docs-landing{% endif %}">
8
+ <section class="documentation {% if is_docs_landing %}docs-landing{% endif %} {{ include.item_type }}">
9
9
  {% assign docs_base_url = product_base_url | append: "docs/" %}
10
10
  {% assign item_docs = include.items | where_exp: "item", "item.url contains docs_base_url" %}
11
11
  {% assign nav = item_docs | where_exp: "item", "item.path contains 'docs/navigation'" | first %}
12
12
 
13
+ {% if nav == nil %}
14
+ {% assign nav = page.navigation %}
15
+ {% endif %}
16
+
13
17
  {% assign num_nav_sections = nav.sections | size %}
14
18
 
15
19
  {% assign item_data = include.items | where_exp: "item", "item.url == product_base_url" | first %}
@@ -22,17 +26,17 @@
22
26
  <div class="logo-container">
23
27
  {% include software-symbol.html item_id=page.id %}
24
28
  </div>
25
- <h3 class="title">
26
- <a href="{{ product_base_url | relative_url }}">{{ item_data.title }}</a>
27
- </h3>
28
29
  {% endif %}
30
+ <h3 class="title">
31
+ <a href="{{ product_base_url | relative_url }}">{{ item_data.title }}</a>
32
+ </h3>
29
33
  </header>
30
34
 
31
35
  <section class="external-links">
32
36
  {% include item-external-links.html item_type=include.item_type item_data=item_data %}
33
37
  </section>
34
38
 
35
- {% elsif num_nav_sections > 0 %}
39
+ {% elsif num_nav_sections > 0 and include.item_type == 'software' %}
36
40
  <header class="sidebar-header">
37
41
  <h3 class="title">
38
42
  Documentation
@@ -45,27 +49,47 @@
45
49
  <h4 class="section-title">{{ section.name }}</h4>
46
50
  <ul class="section-items">
47
51
  {% for item in section.items %}
48
- {% assign link = docs_base_url | append: item | append: "/" %}
52
+ {% if item.path %}
53
+ {% comment %}Spec contents{% endcomment %}
54
+ {% assign item_path = item.path %}
55
+ {% assign link = product_base_url | append: item_path | append: "/" %}
56
+ {% else %}
57
+ {% comment %}Software docs{% endcomment %}
58
+ {% assign item_path = item %}
59
+ {% assign link = docs_base_url | append: item_path | append: "/" %}
60
+ {% endif %}
61
+
49
62
  {% assign linked_page = include.items | where_exp: "item", "item.url contains link" | first %}
50
63
 
51
- {% if page.url != link and linked_page %}
52
- <li class="item">
53
- <a href="{{ link | relative_url }}">
54
- {{ linked_page.title }}
55
- </a>
56
- {% else %}
57
- {% if page.url == link %}
64
+ {% if item.title %}
65
+ {% assign item_title = item.title %}
66
+ {% elsif item.ignore_missing != true %}
67
+ {% assign item_title = linked_page.title %}
68
+ {% endif %}
69
+
70
+ {% if linked_page or item.ignore_missing %}
71
+ {% if page.url != link %}
72
+ <li class="item">
73
+ <a href="{{ link | relative_url }}">
74
+ {{ item_title }}
75
+ </a>
76
+ {% else %}
58
77
  <li class="item selected">
59
78
  <span>
60
- {{ linked_page.title }}
61
- </span>
62
- {% else %}
63
- <li class="item">
64
- <span class="tbd">
65
- {{ item }}
79
+ {{ item_title }}
66
80
  </span>
67
81
  {% endif %}
82
+ {% else %}
83
+ <li class="item">
84
+ <span class="tbd">
85
+ {% if item.title %}
86
+ {{ item.title }}
87
+ {% else %}
88
+ {{ item }}
89
+ {% endif %}
90
+ </span>
68
91
  {% endif %}
92
+
69
93
  {% assign link = "" %}
70
94
  {% endfor %}
71
95
  </ul>
@@ -85,7 +109,7 @@
85
109
  <h1 class="text">{{ page.title }}</h1>
86
110
  </div>
87
111
 
88
- {% if is_docs_landing == false %}
112
+ {% if is_docs_landing == false and item_data.docs.git_repo_url %}
89
113
  <nav>
90
114
  <button class="docs-nav-toggle">Show table of contents</button>
91
115
  <a href="{{ item_data.docs.git_repo_url }}/edit/master/docs/{{ page.path | split: "/" | last }}" class="docs-suggest-edits">Suggest edits to this page</a>
@@ -107,7 +131,7 @@
107
131
  {{ content }}
108
132
  </div>
109
133
 
110
- {% if is_docs_landing == false %}
134
+ {% if is_docs_landing == false and item_data.docs.git_repo_url %}
111
135
  <footer>
112
136
  <nav>
113
137
  <button class="docs-nav-toggle">Show table of contents</button>
@@ -15,6 +15,18 @@
15
15
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
16
16
  {% endif %}
17
17
 
18
+ {% if page.extra_stylesheets %}
19
+ {% for ss in page.extra_stylesheets %}
20
+ <link rel="stylesheet" href="{{ ss.href }}" integrity="{{ ss.integrity }}" crossorigin="{{ ss.crossorigin }}">
21
+ {% endfor %}
22
+ {% endif %}
23
+
24
+ {% if page.extra_scripts %}
25
+ {% for sc in page.extra_scripts %}
26
+ <script src="{{ sc.src }}" integrity="{{ sc.integrity }}" crossorigin="{{ sc.crossorigin }}"></script>
27
+ {% endfor %}
28
+ {% endif %}
29
+
18
30
  {% seo %}
19
31
  </head>
20
32
 
data/_sass/headroom.scss CHANGED
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  body.with-headroom {
13
- &.layout--product {
13
+ &.layout--product, &.layout--spec {
14
14
  .underlay.header {
15
15
  position: fixed;
16
16
  top: 0;
@@ -445,7 +445,8 @@ body {
445
445
  }
446
446
  body > .underlay,
447
447
  body > main,
448
- body > main > .underlay {
448
+ body > main > .underlay,
449
+ .item-filter {
449
450
  display: flex;
450
451
  flex-flow: column nowrap;
451
452
  @media screen and (min-width: $bigscreen-breakpoint) {
@@ -458,6 +459,10 @@ body > main > .underlay {
458
459
  }
459
460
  }
460
461
 
462
+ nav.item-filter > * {
463
+ @include wide-container();
464
+ }
465
+
461
466
  header,
462
467
  footer,
463
468
  section,
@@ -467,12 +472,6 @@ article {
467
472
  body > .underlay > &,
468
473
  body > main > &,
469
474
  body > main > .underlay > & {
470
- @media screen and (min-width: $bigscreen-breakpoint) {
471
- padding: 0;
472
- width: $bigscreen-breakpoint - $gutter * 2;
473
- }
474
- @media screen and (min-width: $widescreen-breakpoint) {
475
- width: $widescreen-breakpoint - $gutter * 2;
476
- }
475
+ @include wide-container();
477
476
  }
478
477
  }
@@ -14,6 +14,16 @@
14
14
  }
15
15
  }
16
16
 
17
+ @mixin wide-container() {
18
+ @media screen and (min-width: $bigscreen-breakpoint) {
19
+ padding: 0;
20
+ width: $bigscreen-breakpoint - $gutter * 2;
21
+ }
22
+ @media screen and (min-width: $widescreen-breakpoint) {
23
+ width: $widescreen-breakpoint - $gutter * 2;
24
+ }
25
+ }
26
+
17
27
  @mixin padded-code-snippet() {
18
28
  padding: 0 1em;
19
29
  margin: 0 .2em;
@@ -234,45 +244,6 @@
234
244
  padding-top: 50px;
235
245
  background: transparent;
236
246
 
237
- &.top-expandable {
238
- border-bottom: 1px solid silver;
239
- z-index: 4;
240
-
241
- position: fixed;
242
- left: 0;
243
- right: 0;
244
-
245
- padding-top: 0;
246
- padding-left: 2em;
247
- padding-right: 2em;
248
-
249
- transition:
250
- background 200ms cubic-bezier(0.23, 1, 0.32, 1),
251
- transform 200ms linear;
252
-
253
- overflow: hidden;
254
-
255
- .sidebar-header {
256
- background: white;
257
- cursor: pointer;
258
- padding-top: 10px;
259
- padding-bottom: 10px;
260
- }
261
-
262
- &.expanded {
263
- box-shadow: 0px -10px 30px 0 rgba(black, 0.8);
264
- z-index: 6;
265
- overflow-y: scroll;
266
- background: white;
267
- border-bottom: none;
268
- }
269
- }
270
-
271
- &.pinned {
272
- z-index: 4;
273
- transform: translateY(0);
274
- }
275
-
276
247
  > .sidebar-header, > section {
277
248
  margin-bottom: 15px;
278
249
  }
@@ -284,6 +255,7 @@
284
255
 
285
256
  .title {
286
257
  flex: 1;
258
+ white-space: nowrap;
287
259
  line-height: 1;
288
260
  font-weight: normal;
289
261
  font-size: 15px;
@@ -369,6 +341,7 @@
369
341
 
370
342
  > header > nav {
371
343
  margin-top: -2em;
344
+ margin-bottom: 4em;
372
345
  }
373
346
 
374
347
  > footer > nav {
@@ -443,6 +416,12 @@
443
416
  }
444
417
  }
445
418
 
419
+ &.specs {
420
+ > article {
421
+ max-width: none;
422
+ }
423
+ }
424
+
446
425
  @media screen and (min-width: $bigscreen-breakpoint) {
447
426
  flex-flow: row nowrap;
448
427
 
@@ -497,4 +476,62 @@
497
476
  }
498
477
  }
499
478
  }
479
+
480
+ &.with-expandable-toc {
481
+ // Is enabled by a script.
482
+
483
+ position: relative;
484
+
485
+ > article {
486
+ border-left-width: 0;
487
+ padding-top: 2em;
488
+
489
+ > header, > .body {
490
+ margin-left: 0;
491
+ }
492
+ }
493
+
494
+ > .docs-nav {
495
+ z-index: 4;
496
+
497
+ &.top-expandable {
498
+ border-bottom: 1px solid silver;
499
+ z-index: 4;
500
+
501
+ position: fixed;
502
+ left: 0;
503
+ right: 0;
504
+
505
+ padding-top: 0;
506
+ padding-left: 2em;
507
+ padding-right: 2em;
508
+
509
+ transition:
510
+ background 200ms cubic-bezier(0.23, 1, 0.32, 1),
511
+ transform 200ms linear;
512
+
513
+ overflow: hidden;
514
+
515
+ .sidebar-header {
516
+ background: white;
517
+ cursor: pointer;
518
+ padding-top: 10px;
519
+ padding-bottom: 10px;
520
+ }
521
+
522
+ &.expanded {
523
+ box-shadow: 0px -5px 20px 0 rgba(black, 0.4);
524
+ z-index: 6;
525
+ overflow-y: scroll;
526
+ background: white;
527
+ border-bottom: none;
528
+ }
529
+ }
530
+
531
+ &.pinned {
532
+ z-index: 4;
533
+ transform: translateY(0);
534
+ }
535
+ }
536
+ }
500
537
  }
data/assets/js/opf.js CHANGED
@@ -123,14 +123,11 @@
123
123
  // to account for top header height
124
124
  var topHeaderHeight = collapsibleHeader.getHeaderHeight();
125
125
 
126
- article.style.paddingTop = '2em';
127
-
126
+ docsRoot.classList.add('with-expandable-toc');
128
127
  docsNav.classList.add('top-expandable');
129
- docsNav.style.zIndex = '4';
130
- docsNav.style.top = '' + topHeaderHeight + 'px';
131
128
 
129
+ docsNav.style.top = '' + topHeaderHeight + 'px';
132
130
  docsNavHeader.innerHTML = docsNavHeader.innerHTML + ' ▼';
133
-
134
131
  docsNavSections.forEach(function (el) {
135
132
  el.style.transition = 'opacity .2s cubic-bezier(0.23, 1, 0.32, 1)';
136
133
  });
@@ -247,13 +244,13 @@
247
244
 
248
245
  var collapsibleHeader;
249
246
 
250
- if (document.querySelector('body.layout--product .documentation:not(.docs-landing)') != null) {
247
+ if (document.querySelector('body.layout--product .documentation:not(.docs-landing), body.layout--spec .documentation:not(.docs-landing)') != null) {
251
248
  collapsibleHeader = initCollapsibleHeader(
252
249
  document.querySelector('.underlay.header'),
253
250
  hamburgerMenu);
254
251
  }
255
252
 
256
- var docsRoot = body.querySelector('body.layout--product .documentation:not(.docs-landing)');
253
+ var docsRoot = body.querySelector('body.layout--product .documentation:not(.docs-landing), body.layout--spec .documentation:not(.docs-landing)');
257
254
  var collapsibleDocsNav;
258
255
 
259
256
  if (docsRoot !== null) {
@@ -273,6 +270,8 @@
273
270
  }
274
271
 
275
272
  var indexFilterEl = document.querySelector('nav.item-filter');
276
- initIndexFilter(indexFilterEl);
273
+ if (indexFilterEl !== null) {
274
+ initIndexFilter(indexFilterEl);
275
+ }
277
276
 
278
277
  }());
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.24
4
+ version: 1.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-16 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.24
75
+ version: 1.1.25
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.24
82
+ version: 1.1.25
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement