forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert docs to use EEP-59 and Markdown #75
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
from
October 20, 2023 10:38
fee192f
to
a0653d4
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
2 times, most recently
from
November 2, 2023 16:03
0c7b28b
to
d91b5f5
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
from
November 6, 2023 14:55
01c0813
to
ebea1b3
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
from
November 17, 2023 09:40
ebea1b3
to
fc3da45
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
4 times, most recently
from
December 8, 2023 09:46
85338d2
to
307c285
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
2 times, most recently
from
December 14, 2023 14:33
aee10c1
to
e41cb06
Compare
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
from
December 20, 2023 14:48
c30e4c1
to
6c61693
Compare
…/OTP-18913 Prepare for EEP59
Update digraph.xml
Optimize the `timer`module by using a private table OTP-18914
Before this fix if a get_until function would return data when eof is seen, the result would not be correctly converted to a binary when returned. closes erlang#4992
Implementation of EEP-59 - Documentation Attributes - Documentation attributes are added to the binary beam file, following format of [EEP-48](https://www.erlang.org/eeps/eep-0048), via `+beam_docs` compiler flag - Warnings related to documentation attributes are dealt with in the `beam_docs.erl` instead of adding them to `erl_lint.erl` *Example 1* ```erlang -module(warn_missing_doc). -export([test/0, test/1, test/2]). -export_type([test/0, test/1]). -type test() :: ok. -type test(N) :: N. -callback test() -> ok. -include("warn_missing_doc.hrl"). test() -> ok. test(N) -> N. ``` Using the compiler flag `warn_missing_doc` will raise a warning when doc. attributes are missing in exported functions, types, and callbacks. *Example 2* ```erlang -module(doc_with_file). -export([main/1]). -moduledoc {file, "README"}. -doc {file, "FUN"}. -spec main(Var) -> foo(Var). main(X) -> X. ``` `moduledoc`s and `doc`s may refer to external files to be embedded. *Example 3 - Warnings and Types* ```erlang -export([uses_public/0]). -export_type([public/0]). -doc false. -type hidden_type() :: integer(). -type intermediate() :: hidden_type(). -type public() :: intermediate(). -spec uses_public() -> public(). uses_public() -> ok. ``` Compiler warns about exported functions whose specs refer to hidden types. In the example above, the `hidden_type()` is set as `hidden` either via `-doc false` or `-doc hidden` and `public() :> intermediate() :> hidden_type()`. When documentation attributes mark a type as hidden, they won't be part of the documentation. Thus, the warning that the `hidden_type()` is not part of the documentation, yet used in an exported function.
…ributes/PR-7936/OTP-18916 Implementation of EEP-59 - Documentation Attributes - Documentation attributes are added to the binary beam file, following format of [EEP-48](https://www.erlang.org/eeps/eep-0048), via `+beam_docs` compiler flag - Warnings related to documentation attributes are dealt with in the `beam_docs.erl` instead of adding them to `erl_lint.erl` *Example 1* ```erlang -module(warn_missing_doc). -export([test/0, test/1, test/2]). -export_type([test/0, test/1]). -type test() :: ok. -type test(N) :: N. -callback test() -> ok. -include("warn_missing_doc.hrl"). test() -> ok. test(N) -> N. ``` Using the compiler flag `warn_missing_doc` will raise a warning when doc. attributes are missing in exported functions, types, and callbacks. *Example 2* ```erlang -module(doc_with_file). -export([main/1]). -moduledoc {file, "README"}. -doc {file, "FUN"}. -spec main(Var) -> foo(Var). main(X) -> X. ``` `moduledoc`s and `doc`s may refer to external files to be embedded. *Example 3 - Warnings and Types* ```erlang -export([uses_public/0]). -export_type([public/0]). -doc false. -type hidden_type() :: integer(). -type intermediate() :: hidden_type(). -type public() :: intermediate(). -spec uses_public() -> public(). uses_public() -> ok. ``` Compiler warns about exported functions whose specs refer to hidden types. In the example above, the `hidden_type()` is set as `hidden` either via `-doc false` or `-doc hidden` and `public() :> intermediate() :> hidden_type()`. When documentation attributes mark a type as hidden, they won't be part of the documentation. Thus, the warning that the `hidden_type()` is not part of the documentation, yet used in an exported function.
This way we can cancel the workflow faster, but it will still run when previous jobs/steps fail.
* lukas/gh/maint-26: gh: Change always to !cancelled
The tools take application/html+erlang EEP-48 style documentation and convert it to EEP-59 style markdown. All erl_docgen types of documentation files are supported. This commit also adds some rudimentory support for generating HTML docs using ex_doc. The support is basically there to test that the XML to Markdown convertion works as intended and is not meant for production use.
This change makes ExDoc rendering look nicer for edoc content.
We do this so that we also test that edoc still works as it should and that ExDoc can render edoc docs nicely.
Instead of using the preloaded beam files for the erts applications beam files, we build new beam files when we have a working compiler. The beam files in the erts application are only used for tools such as dialyzer and EEP-59 documentation.
garazdawi
force-pushed
the
lukas/convert-docs-to-markdown
branch
from
January 16, 2024 18:37
9cb6ebd
to
451bfe1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Things left to do:
index
applicationMove EEP48 docs to Erlang Reference ManualMoved erlang+html docs to edoc, the EEP48 docs were already in kernelfind . -name "*.md" | xargs npx spellchecker-cli -p indefinite-article repeated-words syntax-mentions syntax-urls -q -f
which does not do a spell check, but only check for repeated words and inproper use ofa
vsan
. Running with spell checking on all our .md files takes a very long time...make release
.bugs
Many things I probably forget...