Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Containers and actions for working with Markdown-based specifications.

License

NotificationsYou must be signed in to change notification settings

TrustedComputingGroup/markdown

Repository files navigation

⚠️ This repository containsprototype PDF templating tools for easily using Markdown as source-of-truth for TCG docs. They are currentlyexperimental and not official, final, nor approved.

Create a private repository based on theexample template repository,or set up the GitHub action in any repository using theinstructions below.

Document metadata

Write normal Markdown, with a YAML document metadata block at the top, containing the relevant metadata.

---title: "Document Title"version: 0.1revision: 1date: 2022/09/17type: SPECIFICATIONstatus: DRAFT...

status can be any string, but if it isDRAFT then the tool will render a watermark on the PDF.

status: DRAFT

You can specify either thebluetop orgreentop (default) cover backgrounds with the following optional YAML metadata field:

template: bluetop

or

template: greentop

Separators and page breaks

Horizontal separators are transformed by the workflow into page breaks for readability in both GitHub and PDF views.

---

Tables of contents, figures, and tables

Provide a table of contents, list of figures, and list of tables anywhere(usually, after the disclaimers, change history, and document-style remarks)in the document with:

---\tableofcontents\listoffigures\listoftables---

Tables

Tables in Markdown look like the following:

| **Revision** | **Date**   | **Description** || ------------ | ---------- | --------------- || 0.1/1        | 2022/09/17 | Initial draft   |
RevisionDateDescription
0.1/12022/09/17Initial draft

Informative text blocks

TCG makes use of a gray box for "informative text." To write informative text in your Markdown source, use the block-quote syntax:

>Informative text goes here!>>It can be multiple paragraphs, if you wish.

It will look like this in the GitHub markdown view:

Informative text goes here!

It can be multiple paragraphs, if you wish.

The tool will insert the "Start of informative text" / "End of informative text" delimitersinto the informative text blocks automatically.

Diagrams

You can include diagrams usingMermaid syntax:

```mermaid {caption="Sequence Diagram A"}sequenceDiagramHost->>TPM: TPM2_Startuploop Measurements    Host->>TPM: TPM2_PCR_ExtendendHost->>TPM: TPM2_QuoteTPM->>Host: <quoted PCRs>```

The code above generates a diagram that looks like this:

sequenceDiagramHost->>TPM: TPM2_Startuploop Measurements    Host->>TPM: TPM2_PCR_ExtendendHost->>TPM: TPM2_QuoteTPM->>Host: <quoted PCRs>
Loading

In the example above, "Sequence Diagram A" is the name shown in the figure caption and table of figures.To exclude the caption and table-of-figures entry, leave out the caption on the first line, i.e. just:

```mermaid

Mermaid supports the following types of diagrams:

  • Sequence diagrams (as above)
  • Flow charts
  • Gantt charts
  • UML class diagrams
  • Git branch graphs
  • Andmore

Images

You can also include images if you check them into the root of the repository.Note: GitHub and Pandoc disagree somewhat on the paths to images,so the safest path to success is to keep the Markdown source and image filesall together in theroot of the repository.

![Image B](computer.jpg)

produces:

Image B

In the example above, "Image B" is the name shown in the figure caption and table of figures.To exclude the caption and table-of-figures entry, leave the caption blank (i.e.,![](computer.jpg))

See the samples in the root directory for more examples.

Here is an example of a GitHub Action configuration that renders a Markdown file to PDF, attaches it to the workflow, and checks it into the repo (if not a pull request):

Setting up the GitHub action

name:Renderon:push:branches:      -mainpull_request:workflow_dispatch:jobs:render:runs-on:ubuntu-latestcontainer:image:ghcr.io/trustedcomputinggroup/pandoc:0.3.0name:Render PDFsteps:      -name:Checkoutuses:actions/checkout@v3      -name:Renderuses:trustedcomputinggroup/markdown@v0.2.5with:input-md:main.mdoutput-pdf:spec.pdf      -name:Upload samplesuses:actions/upload-artifact@masterwith:name:spec.pdfpath:spec.pdf      -name:Check in latest renderuses:stefanzweifel/git-auto-commit-action@v4with:commit_message:Generate latest PDFfile_pattern:spec.pdfif:github.event_name != 'pull_request'

How to use this for your document (Local)

Either clone the repository and installPandoc and its dependencies, or

docker pull ghcr.io/trustedcomputinggroup/markdown:latest

When running Pandoc (either directly or usingdocker run), you'll have to pass all the arguments thatthe action does.

How to contribute to this template

Send a PR! A GitHub Action in this repo will automatically run the tools with all your changes on top. You can find the rendered samples under "action validation" in the "checks" tab of your PR:image

About

Containers and actions for working with Markdown-based specifications.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp