Skip to content

Commit

Permalink
Change API header titles and info
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitraka committed Dec 17, 2023
1 parent 1cf717d commit 6ed25c0
Show file tree
Hide file tree
Showing 148 changed files with 350 additions and 8 deletions.
38 changes: 35 additions & 3 deletions cmake/templates/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ breathe_projects_source = {}
hpx_source_dir = '@HPX_SOURCE_DIR@'
hpx_libs_dir = hpx_source_dir + '/libs'
hpx_libs = {}
header_info = {}

def get_info_from_file(source):
title = "None"
header = "None"

if os.path.exists(source):
with open(source, 'r') as file:
# Search for patterns indicating the title and header
for line in file:
if "/// \page" in line:
title = line.split("/// \page", 1)[-1].strip()
elif "/// \headerfile" in line:
header = line.split("/// \headerfile", 1)[-1].strip()

return title, header

# Scan the libs directory for source files to be included in
# the documentation
Expand Down Expand Up @@ -102,13 +118,20 @@ for lib_dir in os.listdir(hpx_libs_dir):
for f in files:
if not file_regex.match(f) is None:
skip = True
for line in open(subdir_full + '/' + f):
header_file_path = subdir_full + '/' + f
for line in open(header_file_path):
if '/// \\' in line:
page_title, include_header = get_info_from_file(header_file_path)
skip = False
break
if skip:
continue
breathe_projects_source[module][1].append(subdir + '/' + f)
include_prefix = 'include/'
include_index = header_file_path.find(include_prefix)
if include_index != -1:
header = header_file_path[include_index + len(include_prefix):]
header_info[header] = (page_title, include_header)

# Generate the rst files for the API documentation
api_refs = ''
Expand Down Expand Up @@ -145,9 +168,11 @@ api_header_file = '''
.. _modules_{0}_api:

-------------------------------------------------------------------------------
{0}
{2}
-------------------------------------------------------------------------------

Defined in header {3}

See :ref:`public_api` for a list of names and headers that are part of the public
|hpx| API.

Expand Down Expand Up @@ -185,8 +210,15 @@ for lib in hpx_libs.keys():
header_name = '{0}_{1}'.format(header_splitted[-3], header_name)
header_names.add(header_name)

# Get the info from the dictionary using the header file path
page_title, include_header = header_info.get(header, ("None", "None"))
if page_title == "None":
page_title = header
if include_header == "None":
include_header = header

header_ref = open(basedir + '/' + header_name + '.rst', 'w')
header_ref.write(api_header_file.format(header, module))
header_ref.write(api_header_file.format(header, module, page_title, include_header))
header_ref.close()
header_refs += ' /libs/' + lib + '/' + module + '/api/' + header_name + '.rst\n'
module_api_ref.write(api_file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/adjacent_difference.hpp
/// \page hpx::adjacent_difference
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/adjacent_find.hpp
/// \page hpx::adjacent_find
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/all_any_none.hpp
/// \page hpx::all_of, hpx::any_of, hpx::none_of
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
2 changes: 2 additions & 0 deletions libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/copy.hpp
/// \page hpx::copy, hpx::copy_n, hpx::copy_if
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/count.hpp
/// \page hpx::count, hpx::count_if
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/destroy.hpp
/// \page hpx::destroy, hpx::destroy_n
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/ends_with.hpp
/// \page hpx::ends_with
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/equal.hpp
/// \page hpx::equal
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/exclusive_scan.hpp
/// \page hpx::exclusive_scan
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
2 changes: 2 additions & 0 deletions libs/core/algorithms/include/hpx/parallel/algorithms/fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/fill.hpp
/// \page hpx::fill, hpx::fill_n
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
2 changes: 2 additions & 0 deletions libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/find.hpp
/// \page hpx::find, hpx::find_if, hpx::find_if_not, hpx::find_end, hpx::find_first_of
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/for_each.hpp
/// \page hpx::for_each, hpx::for_each_n
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/for_loop.hpp
/// \page hpx::experimental::for_loop, hpx::experimental::for_loop_strided, hpx::experimental::for_loop_n, hpx::experimental::for_loop_n_strided
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/for_loop_induction.hpp
/// \page hpx::experimental::for_loop_induction
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/for_loop_reduction.hpp
/// \page hpx::experimental::for_loop_reduction
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/generate.hpp
/// \page hpx::generate, hpx::generate_n
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/includes.hpp
/// \page hpx::includes
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/inclusive_scan.hpp
/// \page hpx::inclusive_scan
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \page hpx::is_heap, hpx::is_heap_until
/// \headerfile hpx/algorithm.hpp

#pragma once

#if defined(DOXYGEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \page hpx::is_partitioned
/// \headerfile hpx/algorithm.hpp

#pragma once

#if defined(DOXYGEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/is_sorted.hpp
/// \page hpx::is_sorted, hpx::is_sorted_until
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/lexicographical_compare.hpp
/// \page hpx::lexicographical_compare
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/make_heap.hpp
/// \page hpx::make_heap
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \page hpx::merge, hpx::inplace_merge
/// \headerfile hpx/algorithm.hpp

#pragma once

#if defined(DOXYGEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// make inspect happy: hpxinspect:nominmax

/// \file parallel/algorithms/minmax.hpp
/// \page hpx::min_element, hpx::max_element, hpx::minmax_element
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/mismatch.hpp
/// \page hpx::mismatch
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
2 changes: 2 additions & 0 deletions libs/core/algorithms/include/hpx/parallel/algorithms/move.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/move.hpp
/// \page hpx::move
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/nth_element.hpp
/// \page hpx::nth_element
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/partial_sort.hpp
/// \page hpx::partial_sort
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/partial_sort_copy.hpp
/// \page hpx::partial_sort_copy
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \page hpx::partition, hpx::stable_partition, hpx::partition_copy
/// \headerfile hpx/algorithm.hpp

#pragma once

#if defined(DOXYGEN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/reduce.hpp
/// \page hpx::reduce
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/reduce_by_key.hpp
/// \page hpx::reduce_by_key
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/remove.hpp
/// \page hpx::remove, hpx::remove_if
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

/// \file parallel/algorithms/remove_copy.hpp
/// \page hpx::remove_copy, hpx::remove_copy_if
/// \headerfile hpx/algorithm.hpp

#pragma once

Expand Down
Loading

0 comments on commit 6ed25c0

Please sign in to comment.