Skip to content

Commit

Permalink
Started cleaning up hardware documentation metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Feb 28, 2023
1 parent b5481de commit f66148f
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 130 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"ADVEMATH",
"adventmath",
"Alexy",
"alldocs",
"altsource",
"AMBERF",
"ANDAL",
Expand Down
21 changes: 17 additions & 4 deletions _includes/gallery/documents.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% assign title = include.title | default: "Documents" %}
{% assign group = include.group | default: "@documents" %}
{% assign group_link = include.link %}
{% assign group_id = title | slugify %}
{% assign group_id = group_link | slugify | prepend: "gallery-" %}
{% assign cover_width = include.width | default: "200" %}
{% assign cover_height = include.height | default: "" %}
{% assign path = include.path | default: include.target | default: page.permalink %}
Expand Down Expand Up @@ -86,13 +86,22 @@ <h4 id="{{ group_id }}">{%- if group_link -%}<a href="{{ group_link }}">{{ title
{%- if doc_title and doc_title != "" and doc_tags contains doc_tag -%}
{%- assign doc_file = doc['@file'] -%}
{%- assign doc_id = doc_file | default: doc_title | slugify -%}
{%- assign doc_source = doc['@source'] -%}{%- if doc_source contains "PCjs" or doc_source contains "pcjs" -%}{%- assign doc_source = "" -%}{%- endif -%}
{%- assign doc_note = "" %}
{%- assign doc_source = doc['@source'] -%}
{%- if doc_source contains "PCjs" or doc_source contains "pcjs" -%}
{%- assign doc_source = "" -%}
{%- assign doc_note = "From the PCjs Archives" -%}
{%- endif -%}
{%- capture doc_path -%}{{ cur_path }}/{{ doc_file }}{%- endcapture -%}
{%- assign doc_link = doc['@link'] | default: doc_source | default: doc_path -%}
{%- if doc_link == doc_source %}
{%- assign doc_source = "" %}
{%- endif %}
{%- assign doc_cover = doc['@cover'] | default: "/documents/covers/default.jpg" -%}
{%- if doc_cover == "gif" or doc_cover == "jpg" or doc_cover == "jpeg" or doc_cover == "png" -%}
{%- assign doc_cover = "." | append: doc_cover -%}
{%- endif %}
{%- assign doc_cover0 = doc_cover | slice: 0 %}
{%- if doc_link contains "http" -%}{%- assign doc_external = true -%}{%- else -%}{%- assign doc_external = false -%}{%- endif -%}
{%- comment -%}
For now, we only embed the first document so marked, to keep things simple.
Expand All @@ -106,10 +115,14 @@ <h4 id="{{ group_id }}">{%- if group_link -%}<a href="{{ group_link }}">{{ title
{%- endif -%}
{%- assign doc_width = doc['@width'] | default: cover_width -%}
{%- assign doc_height = doc['@height'] | default: cover_height -%}
{%- if doc_cover == ".jpg" or doc_cover == ".png" -%}
{%- if doc_cover0 == "." -%}
{%- capture doc_cover -%}{{ cur_path }}/covers/{{ doc_file | replace: ".pdf",doc_cover | replace: ".png",doc_cover }}{%- endcapture -%}
{%- else %}
{%- unless doc_cover contains "/" %}
{%- capture doc_cover -%}{{ cur_path }}/covers/{{ doc_cover }}{%- endcapture -%}
{%- endunless %}
{%- endif -%}
{%- include gallery/image.html id=doc_id image=doc_cover file=doc_file link=doc_link title=doc_title width=doc_width height=doc_height source=doc_source external=doc_external -%}
{%- include gallery/image.html id=doc_id image=doc_cover file=doc_file link=doc_link title=doc_title width=doc_width height=doc_height note=doc_note source=doc_source external=doc_external -%}
{%- endif -%}
{%- endfor -%}
{%- include gallery/end.html -%}
Expand Down
8 changes: 4 additions & 4 deletions _includes/gallery/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
<div class="pcjs-gallery-image">
{%- if include.link -%}
{%- capture image_link %}href="{{ site.baseurl }}{{ include.link }}"{%- if include.external %} target="_blank"{%- endif -%}{%- endcapture %}
<a {{ image_link }}><img src="{{ image_src }}"{{ image_width }}{{ image_height }} alt="{{ include.title }}"></a>
<a {{ image_link }}><img src="{{ image_src }}"{{ image_width }}{{ image_height }} alt="{{ include.title }}" title="{{ include.note }}"></a>
{%- else %}
<img src="{{ image_src }}"{{ image_width }}{{ image_height }} alt="{{ include.title }}">
<img src="{{ image_src }}"{{ image_width }}{{ image_height }} alt="{{ include.title }}" title="{{ include.note }}">
{%- endif %}
</div>
{%- unless include.file contains '/' %}
<span class="pcjs-gallery-label">{{ include.title | replace: "(","<br>(" }}</span>
{%- else %}
<a href="{{ include.file }}"><span class="pcjs-gallery-label">{{ include.title | replace: "(","<br>(" }}</span></a>
<a href="{{ include.file }}" target="_blank"><span class="pcjs-gallery-label">{{ include.title | replace: "(","<br>(" }}</span></a>
{%- endunless %}
{%- if include.source contains "http" %}
<br><span class="pcjs-gallery-label">[<a href="{{ include.source }}">Source</a>]</span>
<br><span class="pcjs-gallery-label">[<a href="{{ include.source }}" target="_blank">Source</a>]</span>
{%- endif -%}
{%- else %}
<span class="pcjs-gallery-label"><a href="{{ site.baseurl }}{{ include.link }}">{{ include.title }}</a></span>
Expand Down
8 changes: 4 additions & 4 deletions documents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ piece of hardware or software featured here) is filed under an appropriate categ

There are a few gray areas. For example, there are programming books that also came with supplemental software, and in a
few cases, we have archived that software supplement as well. So, because this is primarily a software-driven site, and to
keep related materials together as much as possible, such a book will generally be filed with its **Software**, with a reference
to the book within **Documents**.
keep related materials together as much as possible, such a book will generally be filed with its **Software**, with a
reference to the book within **Documents**.

For example, see [Graphics for the IBM PC](/software/pcx86/sw/books/graphics_for_the_ibm_pc/), which is filed under
**Software** / **IBM PC** / **Shareware** / **Books**. However, you will also find the book referenced under
**Documents** / **Books** / **Programming**, in the section titled "[Books with Software](/documents/books/programming/#books-with-software)".
**Software** / **IBM PC** / **Shareware** / **Books**. However, you will also find the book referenced under **Documents** /
**Books** / **Programming**, in the section titled "[Books with Software](/documents/books/programming/#books-with-software)".

{% include gallery/alldocs.html title="All Hardware Documents" root="hardware" %}

Expand Down
2 changes: 0 additions & 2 deletions machines/documents.json
Original file line number Diff line number Diff line change
Expand Up @@ -1162,15 +1162,13 @@
{
"@title": "iAPX 86,88 User's Manual (1981)",
"@link": "http://bitsavers.trailing-edge.com/pdf/intel/_dataBooks/1981_iAPX_86_88_Users_Manual.pdf",
"@file": "iAPX_86_88_Users_Manual--1981.pdf",
"@cover": "/documents/manuals/intel/8086/covers/iAPX_86_88_Users_Manual--1981.jpg",
"@source": "",
"@tags": "8086,manuals"
},
{
"@title": "80286 LOADALL Instruction",
"@link": "/documents/manuals/intel/80286/loadall/",
"@embedSkip": "https://onedrive.live.com/embed?cid=7D567B5161FE0EB7&resid=7D567B5161FE0EB7%219674&authkey=ACh5u1RonNCbNm8&em=2",
"@file": "/documents/manuals/intel/80286/files/80286--LOADALL.pdf",
"@cover": "/documents/manuals/intel/80286/covers/80286--LOADALL.jpg",
"@source": "PCjs",
Expand Down
Loading

0 comments on commit f66148f

Please sign in to comment.