Giter VIP home page Giter VIP logo

docs-spec-template's People

Contributors

a4lg avatar arichardson avatar cmuellner avatar dependabot[bot] avatar henry-hsieh avatar jjscheel avatar kbroch-rivosinc avatar lbmeng avatar rpsene avatar wmat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docs-spec-template's Issues

format yaml files consistently (with a pre-commit hook)

I don't know if there needs to be a discussion on the settings but I'll describe here my thoughts.

My PR would have the folllowing settings:

  - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
    rev: 0.2.3
    hooks:
      - id: yamlfmt
        args: [--mapping, '2', --sequence, '4', --offset, '2']

Based on:

  • defaults of yamlfmt IMO add too much whitespace
  • these settings are a close match to what currently exists
  • 2 spaces, in general is enough to denote indentation w/o extending lines into the the > MAX_LINE_LENGTH
  • this formatting passes yamllint (if that was to be deployed)

PR to follow...

provide html output in workflow

This could be as simple as using asciidoctor tool and/or a static site generator like jekyll or antora could be use to provide a more feature rich website.

possible features:

  • deploy to github pages
  • search
  • complex nav (ability to have multi-page, intra-page)
  • links
    • edit source
    • file issue

refactor Makefile to easily support generation of multiple docs

At least one spec, has multiple output docs. Rather than adding them individually to the existing Makefile structure, it could be refactored to easily support this.

PR to follow will do following:

  • add variable at top to allow for multiple src docs
  • parallelize builds (both pdf/html and mulitiple docs)
  • remove duplication

Tried to update docs-resources to latest main and getting ERROR: could not locate or load the built-in pdf theme `docs-resources/themes/riscv-pdf.yml' because of NoMethodError undefined method `each' for "646b74":String;

❯ git submodule status
 005cb0db1c46c31fff163914f3e480dbda0306be docs-resources (remotes/origin/HEAD)

Tried with docker:

❯ make
Checking if Docker is available...
Docker is available, building inside Docker container...
make[1]: Entering directory '/home/kbroch/rvi/riscv/docs-spec-template'
Starting build inside Docker container...
make build-docs
make[2]: Entering directory '/home/kbroch/rvi/riscv/docs-spec-template'
docker run --rm -v /home/kbroch/rvi/doc-team-repos/docs-spec-template:/build -w /build riscvintl/riscv-docs-base-container-image:latest /bin/sh -c " asciidoctor-pdf --trace -a compress -a mathematical-format=svg -a revnumber=v0.0.0 -a revremark=Draft -a revdate=2024-04-25 -a pdf-fontsdir=docs-resources/fonts -a pdf-theme=docs-resources/themes/riscv-pdf.yml  -D build --failure-level=ERROR --require=asciidoctor-bibtex --require=asciidoctor-diagram --require=asciidoctor-mathematical src/spec-sample.adoc "
asciidoctor: ERROR: could not locate or load the built-in pdf theme `docs-resources/themes/riscv-pdf.yml' because of NoMethodError undefined method `each' for "646b74":String; reverting to default theme
make[2]: *** [Makefile:61: spec-sample.pdf] Error 1
make[2]: Leaving directory '/home/kbroch/rvi/riscv/docs-spec-template'
make[1]: *** [Makefile:78: build-container] Error 2
make[1]: Leaving directory '/home/kbroch/rvi/riscv/docs-spec-template'
make: *** [Makefile:68: build] Error 2

and without:

❯ make build-no-container 
Starting build...
make SKIP_DOCKER=true build-docs
make[1]: Entering directory '/home/kbroch/rvi/riscv/docs-spec-template'
asciidoctor-pdf --trace -a compress -a mathematical-format=svg -a revnumber=v0.0.0 -a revremark=Draft -a revdate=2024-04-25 -a pdf-fontsdir=docs-resources/fonts -a pdf-theme=docs-resources/themes/riscv-pdf.yml  -D build --failure-level=ERROR --require=asciidoctor-bibtex --require=asciidoctor-diagram --require=asciidoctor-mathematical src/spec-sample.adoc 
asciidoctor: ERROR: could not locate or load the built-in pdf theme `docs-resources/themes/riscv-pdf.yml' because of NoMethodError undefined method `each' for "646b74":String; reverting to default theme

            val.each do |key2, val2|
               ^^^^^
make[1]: *** [Makefile:61: spec-sample.pdf] Error 1
make[1]: Leaving directory '/home/kbroch/rvi/riscv/docs-spec-template'
make: *** [Makefile:83: build-no-container] Error 2

build-pdf fails in 'Setup Ruby and Gemfile content' step

The following problems with building asciidoctor PDFs has been seen in the build-pdf workflow.

To identify the error, look for the following error details inside the "bundle install" twistie:

linking shared-object mathematical/mathematical.so
/usr/bin/ld: cannot find -lwebp: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:262: mathematical.so] Error 1

It's most commonly seen (at this time) on local forks where "ubuntu-latest" is now running 22.04, instead of 20.04.

The bug is being investigated but the final fix is not yet available due to intricacies of building the gem mathematical file.

The simplest work around at this time is to hard-code the version statement in your .github/workflows/build-pdf.yml file from:

runs-on: ubuntu-latest

to:

runs-on: ubuntu-20.04

This statement should be found on or around line 22 of the file.

compress generated pdf

I think it would be good if the riscv adoc documents were as small as the latex ones.
Especially considering the fact that I often approach github repos/releases that download at less than 500kbps.

Currently the adoc unpriv is 8x the size of the latex one.

There is a simple -a compress command to put in a makefile, which in my case, yielded 314KiB document out of 1.2MiB. Didn't visibly affect build time.

There are also some external tools that claim to strip more.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.