Skip to content

Commit

Permalink
[libc][docs] reorganize documentation (llvm#118836)
Browse files Browse the repository at this point in the history
This commit does a few things:
* creates libc/docs/headers/ and moves all user API related headers under it.
* updates paths and docgen
* updates the top level index to put these headers under a new "Implementation
  Status" tab.
* rename some of the files to be foo.rst for foo.h (except strings, which is
  currently a mix of string.h and stdlib.h)
* update the heading of some files to be in the form foo.h.
  • Loading branch information
nickdesaulniers authored and chrsmcgrr committed Dec 12, 2024
1 parent bc4c68d commit dd9efb3
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion libc/docs/complex.rst → libc/docs/headers/complex.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

=========
complex.h
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/ctype.rst → libc/docs/headers/ctype.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

=======
ctype.h
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/fenv.rst → libc/docs/headers/fenv.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

======
fenv.h
Expand Down
18 changes: 18 additions & 0 deletions libc/docs/headers/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Implementation Status
=====================

.. toctree::
:maxdepth: 1

complex
ctype
fenv
math/index.rst
search
setjmp
signal
stdbit
stdio
strings
threads
time
8 changes: 4 additions & 4 deletions libc/docs/math/index.rst → libc/docs/headers/math/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _math:

==============
Math Functions
==============
======
math.h
======

.. include:: ../check.rst
.. include:: ../../check.rst

.. raw:: html

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
StdFix Functions
================

.. include:: ../check.rst
.. include:: ../../check.rst

Standards and Goals
-------------------
Expand Down
8 changes: 4 additions & 4 deletions libc/docs/libc_search.rst → libc/docs/headers/search.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=============
Search Tables
=============
========
search.h
========

.. include:: check.rst
.. include:: ../check.rst

---------------
Source Location
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/setjmp.rst → libc/docs/headers/setjmp.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

========
setjmp.h
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/signal.rst → libc/docs/headers/signal.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

========
signal.h
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/stdbit.rst → libc/docs/headers/stdbit.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

========
stdbit.h
Expand Down
8 changes: 4 additions & 4 deletions libc/docs/stdio.rst → libc/docs/headers/stdio.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
===============
StdIO Functions
===============
=======
stdio.h
=======

.. include:: check.rst
.. include:: ../check.rst

---------------
Source location
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/strings.rst → libc/docs/headers/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
String Functions
================

.. include:: check.rst
.. include:: ../check.rst

---------------
Source location
Expand Down
2 changes: 1 addition & 1 deletion libc/docs/threads.rst → libc/docs/headers/threads.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: check.rst
.. include:: ../check.rst

=========
threads.h
Expand Down
8 changes: 4 additions & 4 deletions libc/docs/date_and_time.rst → libc/docs/headers/time.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=======================
Date and Time Functions
=======================
======
time.h
======

.. include:: check.rst
.. include:: ../check.rst

---------------
Source location
Expand Down
13 changes: 1 addition & 12 deletions libc/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,8 @@ stages there is no ABI stability in any form.
:caption: Status

compiler_support
date_and_time
math/index.rst
strings
stdio
stdbit
fenv
libc_search
headers/index.rst
c23
ctype
complex
signal
threads
setjmp

.. toctree::
:hidden:
Expand Down
2 changes: 1 addition & 1 deletion libc/utils/docgen/docgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def print_macros_rst(header: Header, macros: Dict):


def print_impl_status_rst(header: Header, api: Dict):
print(".. include:: check.rst\n")
print(".. include:: ../check.rst\n")

print("=" * len(header.name))
print(header.name)
Expand Down

0 comments on commit dd9efb3

Please sign in to comment.