Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@ jobs:
specs-ietf:
runs-on: ubuntu-latest
steps:
- name: Install docker-compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install --requirement requirements.txt
- run: xml2rfc --version
- run: make all
- uses: actions/upload-artifact@v4
with:
name: specification-docs
path: |
*.html
*.txt
!requirements.txt
- run: npm run build-ietf
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
web/

# IETF builds
json-schema-use-cases.html
json-schema-use-cases.pdf
json-schema-use-cases.txt
relative-json-pointer.html
relative-json-pointer.pdf
relative-json-pointer.txt

# For the Python enviornment
.venv
.refcache/

# For the node-based build tools
node_modules/

.env
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM fedora

RUN dnf install -y ruby python3-pip
RUN gem install kramdown-rfc
RUN pip install xml2rfc

WORKDIR /app

COPY . .

# First covert md to xml. Then convert xml to html
CMD sh -c "xml2rfc --version \
&& ls ietf/*.md | xargs -n1 sh -c 'kramdown-rfc \"\$0\" > \"\${0%.md}.xml\"' \
&& ls ietf/*.xml | xargs -n1 sh -c 'xml2rfc --html \"\$0\" -p web'"
37 changes: 0 additions & 37 deletions Makefile

This file was deleted.

12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,7 @@ features they make available to you.
### Internet-Drafts

To build components that are being maintained as IETF Internet-Drafts, run
`make`. The Makefile will create the necessary Python venv for you as part of
the regular make target.

`make clean` will remove all output including the venv. To clean just the spec
output and keep the venv, use `make spec-clean`.

If you want to run `xml2rfc` manually after running make for the first time, you
will need to activate the virtual environment: `source .venv/bin/activate`.

The version of "xml2rfc" that this project uses is updated by modifying
`requirements.in` and running `pip-compile requirements.in`.
`npm run build-ietf`.

Descriptions of the xml2rfc, I-D documents, and RFC processes:

Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
build:
build:
context: .
working_dir: /app
volumes:
- .:/app:Z
12 changes: 12 additions & 0 deletions ietf/.remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import lintPreset from "../.remarkrc-lint.js";
import remarkLintNoMultipleToplevelHeadings from "remark-lint-no-multiple-toplevel-headings";
import remarkLintFencedCodeMarker from "remark-lint-fenced-code-marker";


export default {
plugins: [
lintPreset,
[remarkLintNoMultipleToplevelHeadings, false],
[remarkLintFencedCodeMarker, "~"]
]
};
32 changes: 32 additions & 0 deletions ietf/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---

stand_alone: true
ipr: trust200902
submissiontype: independent
category: info

author:
- name: Jason Desrosiers
email: [email protected]
role: editor

title: Example

--- abstract

An example of an I-D in markdown

--- middle

# Introduction

## Notational Conventions

{::boilerplate bcp14+}

# Security Considerations

TODO: Required section

--- back

File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "index.js",
"scripts": {
"lint": "eslint . ; remark --no-stdout --frail .",
"build": "remark --rc-path specs/.remarkrc-build.js --output web/"
"build": "remark --rc-path specs/.remarkrc-build.js --output web/",
"build-ietf": "docker-compose run --rm build"
},
"license": "MIT",
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions remark/rehype-link-transformer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { existsSync } from "fs";
import { existsSync } from "node:fs";
import { basename } from "node:path";
import url from "node:url";
import { visit } from "unist-util-visit";
import url from "url";


const rehypeLinkTransformer = () => (tree, vfile) => {
visit(tree, "element", (node) => {
if (node.tagName === "a") {
const href = url.parse(node.properties.href);
if (href.hostname === null && href.pathname?.endsWith(".md") && existsSync(vfile.history[0])) {
href.pathname = href.pathname.replace(/.md$/, ".html");
href.pathname = basename(href.pathname).replace(/.md$/, ".html");
node.properties.href = url.format(href);
}
}
Expand Down
1 change: 0 additions & 1 deletion requirements.in

This file was deleted.

45 changes: 0 additions & 45 deletions requirements.txt

This file was deleted.