From 5c959fb021750cdb37b237103b07f1014d3f2560 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Mon, 1 Jul 2024 01:29:30 -0500 Subject: [PATCH] Try hawmoth instead --- c/p0001.c | 28 ++++++++++++++-------------- docs/c/p0001.rst | 8 +++++--- docs/conf.py | 7 ++++--- docs/requirements.txt | 3 +-- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/c/p0001.c b/c/p0001.c index 123ecc25..bd0f6356 100644 --- a/c/p0001.c +++ b/c/p0001.c @@ -1,17 +1,17 @@ -/* -Project Euler Problem 1 - -I know that this could be done faster with a traditional for loop, but I wanted -to see if iterators were reasonably possible in C, since it makes the prime -number infrastructure a lot easier to set up. - -Problem: - -If we list all the natural numbers below 10 that are multiples of 3 or 5, we -get 3, 5, 6 and 9. The sum of these multiples is 23. - -Find the sum of all the multiples of 3 or 5 below 1000. -*/ +/** + * Project Euler Problem 1 + * + * I know that this could be done faster with a traditional for loop, but I wanted + * to see if iterators were reasonably possible in C, since it makes the prime + * number infrastructure a lot easier to set up. + * + * Problem: + * + * If we list all the natural numbers below 10 that are multiples of 3 or 5, we + * get 3, 5, 6 and 9. The sum of these multiples is 23. + * + * Find the sum of all the multiples of 3 or 5 below 1000. + */ #ifndef EULER_P0001 #define EULER_P0001 #include diff --git a/docs/c/p0001.rst b/docs/c/p0001.rst index f8dab56f..f808e2f8 100644 --- a/docs/c/p0001.rst +++ b/docs/c/p0001.rst @@ -3,6 +3,8 @@ C Implementation of Problem 1 View source code `here on GitHub! `_ -.. autocmodule:: p0001.c - :members: - :undoc-members: +.. c:autosection:: Project Euler Problem 1 + :file: p0001.c + +.. c:autodoc:: p0001.c + :clang: -std=c11 -DAMD_COMPILER=0 diff --git a/docs/conf.py b/docs/conf.py index 9d06252a..cf742f57 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,8 +11,9 @@ basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.insert(0, basedir) sys.path.insert(0, basedir + os.sep + 'python') -c_autodoc_roots = [basedir + os.sep + 'c'] -c_autodoc_compilation_args = ['-std=c11', '-DAMD_COMPILER=0'] +hawkmoth_root = basedir + os.sep + 'c' +hackmouth_clang = ['-std=c11', '-DAMD_COMPILER=0'] +hawmouth_source_uri = 'https://github.com/LivInTheLookingGlass/Euler/blob/master/{source}#L{line}' js_source_path = basedir + os.sep + 'javascript' project = 'Euler' @@ -30,7 +31,7 @@ 'sphinx.ext.inheritance_diagram', 'sphinx.ext.mathjax', 'sphinx.ext.todo', - 'sphinx_c_autodoc', + 'hawmoth', # 'breathe', # 'javasphinx', # 'sphinx_autodoc_typehints', diff --git a/docs/requirements.txt b/docs/requirements.txt index c1ea1c5d..0386823d 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,4 @@ sphinx>=3.1 sphinx-rtd-theme sphinx-js -sphinx-c-autodoc -beautifulsoup4 \ No newline at end of file +hawkmoth \ No newline at end of file