GithubHelp home page GithubHelp logo

rocm / rocm-docs-core Goto Github PK

View Code? Open in Web Editor NEW
12.0 7.0 14.0 2.91 MB

ROCm Documentation Python package for ReadTheDocs build standardization

Home Page: https://rocm.docs.amd.com/projects/rocm-docs-core/en/latest/

License: Other

Python 33.46% JavaScript 2.34% CSS 56.60% HTML 3.88% SCSS 0.62% Dockerfile 0.40% Just 1.41% Jinja 1.03% C++ 0.26%

rocm-docs-core's Introduction

ROCm Documentation Core Utilities

ROCm Docs Core is also distributed as a pip package available from PyPi as rocm-docs-core

Purpose

This repository is comprised of utilities, styling, scripts, and additional HTML content that is common to all ROCm projects' documentation. This greatly aids in maintaining the documentation, as any change to the appearance only needs to be modified in one location.

Usage

Setup

  • Install this repository as a Python package using pip

    • From PyPi: pip install rocm-docs-core
    • From GitHub: pip install git+https://github.com/ROCm/rocm-docs-core.git.
  • Set rocm_docs_theme as the HTML theme

  • Add rocm_docs as an extension

  • Optionally, add rocm_docs.doxygen and sphinxcontrib.doxylink as extensions

For an example, see the test conf.py

Legacy Setup

  • From the rocm_docs package import the function setup_rocm_docs into conf.py for the ReadTheDocs project.
  • Call exactly the following, replacing <PROJECT NAME HERE> with the name of the project.

For an example, see the test legacy conf.py

Documentation

The rocm-docs-core documentation is viewable at https://rocm.docs.amd.com/projects/rocm-docs-core/en/latest/

User Guide

The User Guide describes how users can make use of functionality in rocm-docs-core

It is viewable at https://rocm.docs.amd.com/projects/rocm-docs-core/en/latest/user_guide/user_guide.html

Developer Guide

The Developer Guide provides additional information on the processes in toolchains for rocm-docs-core

It is viewable at https://rocm.docs.amd.com/projects/rocm-docs-core/en/latest/developer_guide/developer_guide.html

Build Documentation Locally

To build the rocm-docs-core documentation locally, run the commands below:

pip install -r requirements.txt
cd docs
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

rocm-docs-core's People

Contributors

samjwu avatar dependabot[bot] avatar saadrahim avatar github-actions[bot] avatar lawruble13 avatar mathiasmagnus avatar neon60 avatar yhuiyh avatar naraenda avatar peterjunpark avatar maetveis avatar parbenc avatar danpetreamd avatar jychang48 avatar lisadelaney avatar rmalavally avatar amitkumar-amd avatar

Stargazers

Braden Stefanuk avatar  avatar  avatar Iman Mohammadi avatar Beatriz Navidad Vilches avatar  avatar  avatar Dominic Charrier avatar  avatar  avatar Stephen Cartwright avatar

Watchers

James Cloos avatar  avatar  avatar Kostas Georgiou avatar Joe McCall avatar  avatar  avatar

rocm-docs-core's Issues

Pitchfork project layout

AFAIK it is the intention to follow the Pitchfork project layout. If that is the case, I would like to suggest moving as many of the hidden configuration files in the root of the project into a tools folder, as per § 2.8 of the spec:

The tools/ directory is designated for holding extra scripts and tools related to developing and contributing to the project. For example, turn-key build scripts, linting scripts, code-generation scripts, test scripts, or other tools that may be useful to a project develop.

The contents of this directory should not be relevant to a project consumer.

At the time of writing this touches upon the following files:

  • .markdownlint-cli2.yaml
  • .pre-commit-config.yaml
  • .readthedocs.yaml
  • .spellcheck.yaml
  • .wordlist.txt

There are more hidden files which aren't needed for users of the project, but some are location-sensitive and can't be placed elsewhere:

  • .dockerignore
  • .gitignore
  • .gitpod.yml

Format link to main docs

  • Less space between ROCm Documentation Home link and Docs page Home link
  • Bigger ROCm Documentation Home link

Unneeded internet access

When building the documentation for hipcc, which uses this package, the system attempts to download inventories (objects.inv) files from the 3 repos listed in the intersphinx_mapping around https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/src/rocm_docs/core.py#L91 and generates warnings if they can't be downloaded.

All this appears to do is slow the build down. The generated documentation appears to be the same regardless of the success/failure of the download.

Links in headers need updates

image

The GitHub Link should go to the github page of the current documentation page.

The support page should take you to an issue creation page in the current repository.

Please add code to create this link based on the repository that we are building for.

All the links should open in a new window or tab in the browser.

Document projects.yaml

          > Projects should be defined in projects.yaml and should set which key

they correspond their by setting external_projects_current_project
to this key.

I.e. given this projects.yaml

projects:
  python: https://docs.python.org/3/
  rtd: https://docs.readthedocs.io/en/stable/
  sphinx: https://www.sphinx-doc.org/en/master/
  rocm-docs-core: [https://rocm.docs.amd.com/projects/rocm-docs-core/en/${version}](https://rocm.docs.amd.com/projects/rocm-docs-core/en/$%7Bversion%7D)

conf.py from rocm-docs-core should contain:

external_projects_current_project = "rocm-docs-core"

Adds support for specifying the "development" branch for each project
defined in projects.yaml, this is achieved by setting the
development_branch key for the project I.e.:

projects:
  ...
  project:
    target: <target-url>
    development_branch: master

With this the mapping between projects is changed to the following

  • Development branches map between each-other,
    i.e. links on the "develop" branch of project A point to the "master"
    branch of project "B" and vice-versa if A has set its
    "development branch" to develop and B sets it to "master".

  • Symbolic versions "latest" and "stable" map to themselves in other
    projects

  • Any other branch maps to "latest"


This commit message is very helpful for using these settings. I wonder if we should add a user guide in the docs pages.

Originally posted by @samjwu in #141 (review)

Update banner message based on branch

On the newest tagged version, there should be no banner

On develop/master, the banner should state that the page is unreleased or a future version

For others, the banner should state that the page is an old version (i.e.: not latest)

v0.18.3 breaks TOC generation

This commit doesn't only add projects, but also renames them (seemingly for cosmetic reasons). This breaks TOC generation for all docs even in retrospect. The point of this file is to give stable names to links which may potentially change overtime.

Changing migraphx to amdmigraphx and composable-kernel to composable_kernel breaks all working branches, but will also break all of the backported and non-latest branched versions of the docs.

Please revert the aesthetic changes, which isn't worth the effort of having to update and retag all our pre-existing docs.

Declare parallel reads

Building a repository with the -j (parallel build) option that uses rocm-docs-core gives the following warning:

WARNING: the rocm_docs extension does not declare if it is safe for parallel reading, assuming it isn't - please ask the extension author to check and make it explicit
WARNING: doing serial read

Auto read time

Add auto "read time" based on doc length in article info.

eg: 1 min per 100 char

Documentation Version Number in CMakeLists.txt

Get the version from CMakeLists.txt
Use rocm_setup_version string by default
If it doesn't exist, do custom regex in conf.py

example: rocBLAS
rocm_setup_version( VERSION ${VERSION_STRING} )

Need a common 404 page for docs

Method 1: Copy over a 404.md via rocm-docs-core to docs directory for each repo before Sphinx builds docs

Method 2: Point all to the ROCm 404 page

Method 3: Create 404.md for each repo

Documentation Standardization

Apply the following changes to project documentation for ReadtheDocs:

  • add version number to documentation left navigation bar and page title
  • add an "About" section with a license page
  • enable htmlzip, pdf, epub formats when publishing on Read the Docs
  • set pdf title, author, copyright, and version
  • rename .sphinx/.doxygen to sphinx/doxygen
  • remove docBin from URL
  • update rocm-docs-core dependency
  • update dependabot config

List

  • GPUOpen-ProfessionalCompute-Libraries MIVisionX
  • GPUOpen-ProfessionalCompute-Libraries rpp
  • ROCm-Developer-Tools HIP
  • ROCm-Developer-Tools HIP-VS
  • ROCm-Developer-Tools HIPCC
  • ROCm-Developer-Tools HIPIFY
  • ROCm-Developer-Tools ROCdbgapi-docs
  • ROCm-Developer-Tools ROCgdb-docs
  • ROCm-Developer-Tools ROCmValidationSuite
  • ROCm-Developer-Tools rocprofiler-docs
  • ROCm-Developer-Tools roctracer-docs
  • ROCmSoftwarePlatform AMDMIGraphX
  • ROCmSoftwarePlatform MIOpen
  • ROCmSoftwarePlatform TransferBench
  • ROCmSoftwarePlatform composable_kernel
  • ROCmSoftwarePlatform hip-python main
  • ROCmSoftwarePlatform hipBLAS
  • ROCmSoftwarePlatform hipBLASLt
  • ROCmSoftwarePlatform hipCUB
  • ROCmSoftwarePlatform hipFFT
  • ROCmSoftwarePlatform hipRAND
  • ROCmSoftwarePlatform hipSOLVER
  • ROCmSoftwarePlatform hipSPARSE
  • ROCmSoftwarePlatform hipSPARSELt
  • ROCmSoftwarePlatform hipTensor
  • ROCmSoftwarePlatform hipfort
  • ROCmSoftwarePlatform rccl
  • ROCmSoftwarePlatform rocAL
  • ROCmSoftwarePlatform rocALUTION
  • ROCmSoftwarePlatform rocBLAS
  • ROCmSoftwarePlatform rocFFT
  • ROCmSoftwarePlatform rocPRIM
  • ROCmSoftwarePlatform rocRAND
  • ROCmSoftwarePlatform rocSOLVER
  • ROCmSoftwarePlatform rocSPARSE
  • ROCmSoftwarePlatform rocThrust
  • ROCmSoftwarePlatform rocWMMA
  • RadeonOpenCompute ROCR-Runtime
  • RadeonOpenCompute ROCm
  • RadeonOpenCompute amdsmi
  • RadeonOpenCompute rdc
  • RadeonOpenCompute rocm-cmake
  • RadeonOpenCompute rocm-docs-core
  • RadeonOpenCompute rocm_smi_lib

Create test cases

There should be test cases to validate the functionality of rocm-docs-core for both legacy and theme users (aptly demonstrated by the confusion around #88).

Set up separate source for components for updates

create a separate source for components that are frequently updated
rocm-docs-core can reference these components instead of hard-coding them

Goal: make updating components that need frequent changes (eg: announcements) easier in that it won't require bumping versions and updating dependencies for all libraries for small changes

Possibilities:

  • separate repo
  • gist
  • separate file in main or develop branch

Version substition

Problem case

Currently in main ROCm documentation, versions are kept up to date manually.
Updating this is error prone (i.e. forgetting to update a string).
Having a mechanism to do this programmatically would help greatly.

Myst already has substitutions, but this does not work within code blocks, which is mainly used for showing install instructions.

Possible solutions

  • Add a simple string replace pre-processing step.

  • There is a sphinx extension that might do the job, however this does not work with Myst. There is a PR that resolves that but requires additional fix-ups to get merged: adamtheturtle/sphinx-substitution-extensions#235

  • Add a Jinja (or other templating engine) pre-processing step that processes *.md.jinja or *.jinja.md-files first before cotinuining with normal Myst/Sphinx steps.

    • Myst already has some form of Jinja support with substitutions, so this might conflict.
    • Depending on your point of view, this might be useful/overkill.

Input files with LaTeX formulas are changed during build

In the hipfort docs build, equations seem to be causing some troubles with the copy.

lib/hipfort/hipfort_hipblas.f:

  !>  \brief SOLVER API
  !> 
  !>     \details
  !>     getrs solves a system of n linear equations on n variables in its factorized form.
  !> 
  !>     It solves one of the following systems, depending on the value of trans:
  !> 
  !>     \f[
  !>         \begin{array}{cl}
  !>         A X = B & \: \text{not transposed,}\\
  !>         A^T X = B & \: \text{transposed, or}\\
  !>         A^H X = B & \: \text{conjugate transposed.}
  !>         \end{array}
  !>     \f]

docs/doxygen/input/hipfort_hipblas.f:

  !>  \brief SOLVER API
  !> 
  !>     \details
  !>     getrs solves a system of n linear equations on n variables in its factorized form.
  !> 
  !>     It solves one of the following systems, depending on the value of trans:
  !> 
  !>     \f[
  !>         \begin{array}{cl}
  !>         A X = B & \: \text{not transposed,}\  !>         A^T X = B & \: \text{transposed, or}\  !>         A^H X = B & \: \text{conjugate transposed.}


  !>         \end{array}
  !>     \f]

rocm-docs-core should be a sphinx extension

As noted in #32 rocm-docs-core should provide all of its functionality as a sphinx extension.

The sphinx API seems to provide all the features that rocm-docs-core needs (i.e. requiring other extensions, modifying settings, installing files.)

This would:

  • clean up the consumer interface (no more copying variables into the global scope)
  • clean up rocm-docs-core internals (it is currently partly a plugin and partly not, some code is duplicated so that calls from clients can happen in any order)
  • would allow for more modularization making parts of the project useful outside of rocm documentation (i.e. running doxygen and doxysphinx automatically)

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.