-
Notifications
You must be signed in to change notification settings - Fork 524
Adopt ExDoc & Move Documentation In-Tree #2973
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
Open
jessestimpson
wants to merge
6
commits into
erlang:main
Choose a base branch
from
jessestimpson:exdoc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,152
−21
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d80a5a3
let's try out exdoc
jessestimpson 6d71337
Include rebar3.org docs
jessestimpson f68fcf6
Add docs from rebar3.org, reworked for ExDoc
jessestimpson 987d920
Hack in support for groups_for_extras
jessestimpson fff3014
rebar3_ex_doc 0.2.31 supports groups_for_extras
jessestimpson 67808df
Define public API for docs by excluding private modules
jessestimpson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,4 @@ env | |
|
|
||
| # hex_core artifact | ||
| apps/rebar/src/vendored/r3_safe_erl_term.erl | ||
| apps/rebar/doc | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| -module(cth_fail_fast). | ||
| -moduledoc false. | ||
|
|
||
| %% Callbacks | ||
| -export([id/1]). | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| -module(cth_retry). | ||
| -moduledoc false. | ||
|
|
||
| %% Callbacks | ||
| -export([id/1]). | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| %% ./bootstrap | ||
| %% REBAR_CONFIG=doc.config ./rebar3 ex_doc | ||
|
|
||
| {project_plugins, [ | ||
| {rebar3_ex_doc, "0.2.30"}, | ||
| {rebar3_hex, "7.0.11"} | ||
| ]}. | ||
|
|
||
| {hex, [{doc, #{provider => ex_doc}}]}. | ||
| {ex_doc, [ | ||
| {source_url, ~"https://example.com"}, | ||
| {extras, [ | ||
| ~"README.md", | ||
| ~"LICENSE", | ||
| ~"CONTRIBUTING.md" | ||
jessestimpson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ]}, | ||
| {main, ~"readme"} | ||
| ]}. | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| case filelib:is_dir("rebar3.org") of | ||
| true -> | ||
| ok; | ||
| false -> | ||
| erlang:error(""" | ||
| This demo requires that you clone the rebar3.org repository from GitHub | ||
| so that we can bundle the documentation together. | ||
|
|
||
| git clone https://github.com/tsloughter/rebar3.org.git | ||
| """) | ||
| end, | ||
|
|
||
| GetRebar3OrgFiles = fun() -> | ||
| Files = filelib:wildcard("rebar3.org/content/en/docs/**/*.md"), | ||
| lists:filter(fun(X) -> nomatch =:= re:run(X, "_index", [{capture, none}]) end, Files) | ||
| end, | ||
|
|
||
| FixHeader = fun(File) -> | ||
| io:format("Processing ~p~n", [File]), | ||
| {ok, Content} = file:read_file(File), | ||
| NewContent = re:replace(Content, "^---$\n+title: \"(?<title>[^\"]*)\"$.*^---$", "# \\1", [unicode, dotall, anchored, multiline]), | ||
| file:write_file(File, NewContent), | ||
| File | ||
| end, | ||
|
|
||
| MdFiles = GetRebar3OrgFiles(), | ||
| MdFiles = lists:map(FixHeader, MdFiles), | ||
|
|
||
| ExDoc = proplists:get_value(ex_doc, CONFIG), | ||
| Extras = proplists:get_value(extras, ExDoc), | ||
| Extras2 = Extras ++ MdFiles, | ||
| ExDoc2 = lists:keystore(extras, 1, ExDoc, {extras, Extras2}), | ||
| CONFIG2 = lists:keystore(ex_doc, 1, CONFIG, {ex_doc, ExDoc2}), | ||
| CONFIG2. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.