Skip to content

Commit f415cfa

Browse files
committed
Fix markup in README.rst
1 parent 3506f62 commit f415cfa

File tree

2 files changed

+36
-30
lines changed

2 files changed

+36
-30
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ repos:
3838
- id: rst-directive-colons
3939
- id: rst-inline-touching-normal
4040

41+
- repo: https://github.com/rstcheck/rstcheck
42+
rev: "v6.2.5"
43+
hooks:
44+
- id: rstcheck
45+
additional_dependencies: ["rstcheck[sphinx,toml]"]
46+
4147
- repo: https://github.com/codespell-project/codespell
4248
rev: "v2.2.5"
4349
hooks:

README.rst

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Setup
3232

3333
npm install typedoc@0.28
3434

35-
JSDoc 3.6.3 and 4.0.0 and TypeDoc 0.25--0.28 are known to work.
36-
35+
JSDoc 3.6.3 and 4.0.0 and TypeDoc 0.25--0.28 are known to work.
3736

3837
2. Install sphinx-js, which will pull in Sphinx itself as a dependency::
3938

@@ -453,7 +452,7 @@ variants:
453452

454453
* a ``sphinx_js.ir.TypeXRefInternal`` with fields ``path`` and ``kind``
455454
* a ``sphinx_js.ir.TypeXRefExternal`` with fields ``name``, ``package``,
456-
``sourcefilename`` and ``qualifiedName``
455+
``sourcefilename`` and ``qualifiedName``
457456

458457
The return value should be restructured text that you wish to be inserted in
459458
place of the type. For example:
@@ -505,7 +504,7 @@ Configuration Reference
505504
A link to a TypeScript config file.
506505

507506
The ``ts_sphinx_js_config`` file
508-
------------------------------
507+
--------------------------------
509508

510509
This file should be a TypeScript module. It's executed in a context where it can
511510
import ``typedoc`` and ``sphinx_js``. These functions take TypeDoc IR objects as
@@ -525,7 +524,7 @@ functions::
525524
destructured. If so, it's equivalent to putting a ``@destructure`` tag for the
526525
argument. For example:
527526

528-
.. code_block:: ts
527+
.. code-block:: ts
529528
530529
function shouldDestructureArg(param: ParameterReflection) {
531530
return param.name === "options";
@@ -546,7 +545,7 @@ functions::
546545
For example, this ``postConvert`` hook removes the constructor from classes marked with
547546
``@hideconstructor``.
548547

549-
.. code_block:: ts
548+
.. code-block:: ts
550549
551550
function postConvert(app, project, typeDocToIRMap) {
552551
for (const [key, value] of typeDocToIRMap.entries()) {
@@ -558,18 +557,20 @@ functions::
558557
559558
To use it, you'll also need to add a tag definition for ``@hideconstructor`` to your ``tsdoc.json`` file:
560559

561-
.. code_block:: json
560+
.. code-block:: json
562561
563-
"tagDefinitions": [
564-
{
565-
"tagName": "@hideconstructor",
566-
"syntaxKind": "modifier"
567-
}
568-
]
562+
{
563+
"tagDefinitions": [
564+
{
565+
"tagName": "@hideconstructor",
566+
"syntaxKind": "modifier"
567+
}
568+
]
569+
}
569570
570571
This ``postConvert`` hook hides external attributes and functions from the documentation:
571572

572-
.. code_block:: ts
573+
.. code-block:: ts
573574
574575
function postConvert(app, project, typeDocToIRMap) {
575576
for (const [key, value] of typeDocToIRMap.entries()) {
@@ -610,7 +611,7 @@ For a TypeScript example, see `the Pyodide api docs
610611
Sphinx docs and now supports sphinx-js. Put this in the
611612
``.readthedocs.yml`` file at the root of your repo:
612613

613-
.. code_block:: yaml
614+
.. code-block:: yaml
614615
615616
python:
616617
install:
@@ -653,14 +654,13 @@ Version History
653654

654655
5.0.0: (Unreleased)
655656
* Dropped support for Python 3.9 (pyodide/sphinx-js-fork#7)
656-
* Dropped support for typedoc 0.15, added support for typedoc 0.25--0.28
657-
(pyodide/sphinx-js-fork#11, pyodide/sphinx-js-fork#22,
657+
* Dropped support for typedoc 0.15, added support for typedoc 0.25--0.28 (
658+
pyodide/sphinx-js-fork#11, pyodide/sphinx-js-fork#22,
658659
pyodide/sphinx-js-fork#31, pyodide/sphinx-js-fork#39,
659660
pyodide/sphinx-js-fork#41, pyodide/sphinx-js-fork#43
660661
pyodide/sphinx-js-fork#52, pyodide/sphinx-js-fork#53,
661662
pyodide/sphinx-js-fork#54, pyodide/sphinx-js-fork#174,
662-
#266
663-
)
663+
#266)
664664
* Added handling for TypeScript type parameters and type bounds.
665665
(pyodide/sphinx-js-fork#25)
666666
* Only monkeypatch Sphinx classes when sphinx_js extension is used
@@ -671,17 +671,17 @@ Version History
671671
(pyodide/sphinx-js-fork#47)
672672
* Added support for destructuring the documentation of keyword arguments in
673673
TypeScript using the ``@destructure`` tag or the
674-
``shouldDestructureArg`` hook.
675-
(pyodide/sphinx-js-fork#48, pyodide/sphinx-js-fork#74,
676-
pyodide/sphinx-js-fork#75, pyodide/sphinx-js-fork#101,
677-
pyodide/sphinx-js-fork#128)
678-
* Added rendering for cross references in TypeScript types.
679-
(pyodide/sphinx-js-fork#51, pyodide/sphinx-js-fork#56,
680-
pyodide/sphinx-js-fork#67, pyodide/sphinx-js-fork#81,
681-
pyodide/sphinx-js-fork#82, pyodide/sphinx-js-fork#83,
682-
pyodide/sphinx-js-fork#153, pyodide/sphinx-js-fork#160)
683-
* Added rendering for function types in TypeScript documentation.
684-
(pyodide/sphinx-js-fork#55, pyodide/sphinx-js-fork#58,
674+
``shouldDestructureArg`` hook. (
675+
pyodide/sphinx-js-fork#48, pyodide/sphinx-js-fork#74,
676+
pyodide/sphinx-js-fork#75, pyodide/sphinx-js-fork#101,
677+
pyodide/sphinx-js-fork#128)
678+
* Added rendering for cross references in TypeScript types. (
679+
pyodide/sphinx-js-fork#51, pyodide/sphinx-js-fork#56,
680+
pyodide/sphinx-js-fork#67, pyodide/sphinx-js-fork#81,
681+
pyodide/sphinx-js-fork#82, pyodide/sphinx-js-fork#83,
682+
pyodide/sphinx-js-fork#153, pyodide/sphinx-js-fork#160)
683+
* Added rendering for function types in TypeScript documentation. (
684+
pyodide/sphinx-js-fork#55, pyodide/sphinx-js-fork#58,
685685
pyodide/sphinx-js-fork#59)
686686
* Add async prefix to async functions (pyodide/sphinx-js-fork#65).
687687
* Added the ``sphinx-js_type`` css class around all types in documentation. This

0 commit comments

Comments
 (0)