Skip to content

[RFC-WIP] docs: move wiki's Board documentation to Doxygen#8508

Closed
jia200x wants to merge 7 commits intoRIOT-OS:masterfrom
jia200x:board_doc
Closed

[RFC-WIP] docs: move wiki's Board documentation to Doxygen#8508
jia200x wants to merge 7 commits intoRIOT-OS:masterfrom
jia200x:board_doc

Conversation

@jia200x
Copy link
Copy Markdown
Member

@jia200x jia200x commented Feb 1, 2018

Contribution description

This PR WIP RFC is an initial approach to move the Board Wiki documentation to the Doxygen documentation. The motivation is to help developers keeping an up-to-date End User documentation for each board without adding too much overhead, and help the End User to find all the documentation in the same place. With this implementation, it's possible to add a new board with documentation without touching any doc file besides the ones in the boards folder.

Help from Bash/Doxygen experts will be appreciated as always.

I provide here the initial implementation with all the tools for generating the Board documentation, and some dummy md files for SamR21 and IotLAB-M3.

How it works

  • For a given board, a doc/board.md file is placed inside the <board_name> folder. E.g:
    boards/samr21-xpro/doc/board.md
    For samr21, this md file would be a copy of this entry
  • The first line of this file should indicate the family of the board with an HTML comment (ARM, MSP430).E.g (boards/samr21-xpro/doc/board.md):
<!--arm-->
SAMR21-xpro
===========
Hello world
  • There is a boards/doc folder with multiple Markdown files, one for each family. These files provide all information about the CPU family (like the ARM entry in RIOT wiki). The board specific HTML comment (<!--arm-->) must match the name of the file with the family file (I provide here a boards/doc/arm.md).
  • make doc
  • The content of the wiki will be available from a Boards entry in the top Navbar.

Technical details

  • There is a list of tools in dist/tools/docgen to generate md files for the Board documentation. These files are not being tracked by git.

RFC/Ideas

  • Less BASH/Doxygen magic? (Help needed here!)
  • Where to store images?
  • HTML comments for family matching? Any ideas?

Issues/PRs references

References #8479

@basilfx
Copy link
Copy Markdown
Member

basilfx commented Feb 2, 2018

I really like having the (board) documentation as part of repository!

HTML comments for family matching? Any ideas?

Not sure if feasible, but would it be possible to retrieve this information from the general Makefiles? If the name of the doc page matches the board's name, then it should be possible to inspect the Makefile and take all the information from there?

@PeterKietzmann PeterKietzmann added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: doc Area: Documentation Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR labels Feb 2, 2018
@jnohlgard
Copy link
Copy Markdown
Member

I did not look at the code, so I don't know if you already did, but it should be possible via the semi-hidden wiki git repository to extract all the board markdown from the wiki and import it into these files.
Regarding images, maybe we could create a separate repo on the RIOT-OS organisation that can be used as a storage for the images. It's not ideal though, so there might be much better solutions

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

Not sure if feasible, but would it be possible to retrieve this information from the general Makefiles? If the name of the doc page matches the board's name, then it should be possible to inspect the Makefile and take all the information from there?

@basilfx Yes, it's somehow possible. Since the script detects all boards with a doc folder inside, it would be possible to retrieve CPU family with "make info-" like commands. The only issue now is usually this commands are activated inside an app.

I did not look at the code, so I don't know if you already did, but it should be possible via the semi-hidden wiki git repository to extract all the board markdown from the wiki and import it into these files.

@gebart Yes, indeed.

Regarding images, maybe we could create a separate repo on the RIOT-OS organisation that can be used as a storage for the images. It's not ideal though, so there might be much better solutions

Yes, I think it's a good approach. As far as I see, in the current state there are several wiki pages pointing to external resources. I'm not sure if it's the same for all boards

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Feb 2, 2018

I like the idea of moving board documentation from the wiki to the code base.

Unfortunately, I'm not convinced by the proposed approach or maybe I misunderstood it.

  • This breaks the existing board module already used in doxygen. How do you link a board to the existing boards module group ?
  • I don't think adding a new menu entry in the top menu makes sense, just reuse the existing doxygen boardsgroup

For me, the actual approach is moving the existing problem, e.g duplicated board documentation, from one place (the wiki) to another (new markdown files in the code base).

I would rather add a doc.txt file in each board directory see the feather-m0 or some arduino-mkr for example. The doc.txt can contain Markdown compatible documentation.
You can also use doxygen commands (@ref, @see, etc) to nicely link things (CPU, boards, drivers) in the documentation.

Regarding the link to images, there are 2 possibilities (as already mentioned):

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

@aabadie:

I would rather add a doc.txt file in each board directory see the feather-m0 or some arduino-mkr for example. The doc.txt can contain Markdown compatible documentation.
You can also use doxygen commands (@ref, @see, etc) to nicely link things (CPU, boards, drivers) in the documentation.

I tend to like the idea, but is it possible to somehow have the same structure as the wiki with this approach? E.g, append the SAMR21 Board entry to the wiki entry and have all the information in the same page?

I don't think adding a new menu entry in the top menu makes sense, just reuse the existing doxygen boardsgroup

IMO Supported Boards is more than a single entry in the Modules group. E.g the openthread.io and contiki-os.org sites have both an exposed entry to the supported platform.

Not sure if should be a link to the Boards group, but I think it's important to have at least a page with all info related to Supported Boards.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Feb 2, 2018

is it possible to somehow have the same structure as the wiki with this approach? E.g, append the SAMR21 Board entry to the wiki entry and have all the information in the same page?

Yes, it's just a matter of changing the groups hierarchy in doxygen: boards > boards_family > boards_arm_xxx.
The question is do we want to keep this structure ?

Not sure if should be a link to the Boards group, but I think it's important to have at least a page with all info related to Supported Boards.

We already have this http://doc.riot-os.org/group__boards.html
Maybe the boards group documentation could be improved with additional links (how to build, cpus, etc).

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

I tend to like the idea, but is it possible to somehow have the same structure as the wiki with this approach? E.g, append the SAMR21 Board entry to the wiki entry and have all the information in the same page?

Just checked the files and yes, seems to be possible. I will try to go that way

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

The question is do we want to keep this structure ?

Not sure if grouping them by family name gives too much value to doc consumers. And also, IMO just adds complexity.
I would live it as the current Board entry in Doxygen

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

@aabadie btw thx for the feedback

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Feb 2, 2018

Just a side comment regarding shell scripts. I'm wondering if it won't be simpler to use Python for the migration script.
Following the idea, we could even imagine a python script that generate an empty structure for a board support (or a driver) with the right files/directories and copyright headers, etc

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 2, 2018

Just a side comment regarding shell scripts. I'm wondering if it won't be simpler to use Python for the migration script.
Following the idea, we could even imagine a python script that generate an empty structure for a board support (or a driver) with the right files/directories and copyright headers, etc

I like the idea, like Django's djando-admin.py startproject or djando-admin.py startapp. Could be used for almost all RIOT componentes (apps, tests, drivers, sys, etc).

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Feb 2, 2018

Could be used for almost all RIOT components (apps, tests, drivers, sys, etc).

Yes. Using Python could help since this will mainly concern string managements and Python is very good for that.

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Feb 5, 2018

I will close this one in favor of #8516.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants