-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also: - made it installable!
- Loading branch information
Showing
39 changed files
with
182 additions
and
114 deletions.
There are no files selected for viewing
This file contains 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,3 +1,3 @@ | ||
[submodule "external/mcss"] | ||
path = external/mcss | ||
[submodule "poxy/data/mcss"] | ||
path = poxy/data/mcss | ||
url = https://github.com/marzer/m.css.git |
File renamed without changes.
This file contains 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,2 @@ | ||
# poxy | ||
Documentation generator for C++ based on Doxygen and [mosra/m.css](https://mcss.mosra.cz/). |
This file contains 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,9 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/dox and is subject to the the terms of the MIT license. | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/dox/blob/master/LICENSE for the full license text. | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
from dox import main | ||
from poxy import main | ||
|
||
main() | ||
if __name__ == '__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,7 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
from .run import run, main |
This file contains 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,13 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
try: | ||
from poxy.run import main | ||
except: | ||
from run import main | ||
|
||
if __name__ == '__main__': | ||
main() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule mcss
updated
from 000000 to b53d11
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains 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
File renamed without changes.
This file contains 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,11 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/dox and is subject to the the terms of the MIT license. | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/dox/blob/master/LICENSE for the full license text. | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
try: | ||
from dox.utils import * | ||
from poxy.utils import * | ||
except: | ||
from utils import * | ||
|
||
|
This file contains 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,12 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/dox and is subject to the the terms of the MIT license. | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/dox/blob/master/LICENSE for the full license text. | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
try: | ||
from dox.utils import * | ||
import dox.soup as soup | ||
from poxy.utils import * | ||
import poxy.soup as soup | ||
except: | ||
from utils import * | ||
import soup | ||
|
@@ -161,7 +161,7 @@ class Modifiers1(_ModifiersBase): | |
|
||
@classmethod | ||
def __substitute(cls, m, out): | ||
return f'{m[1]}<span class="dox-injected m-label m-flat {cls._modifierClasses[m[2]]}">{m[2]}</span>{m[3]}' | ||
return f'{m[1]}<span class="poxy-injected m-label m-flat {cls._modifierClasses[m[2]]}">{m[2]}</span>{m[3]}' | ||
|
||
def __call__(self, doc, context): | ||
if doc.article_content is None: | ||
|
@@ -216,7 +216,7 @@ def __call__(self, doc, context): | |
lastInserted = doc.new_tag('span', | ||
parent=end, | ||
string=match, | ||
class_=f'dox-injected m-label {self._modifierClasses[match]}', | ||
class_=f'poxy-injected m-label {self._modifierClasses[match]}', | ||
before=lastInserted | ||
) | ||
lastInserted.insert_after(' ') | ||
|
@@ -572,7 +572,7 @@ class AutoDocLinks(object): | |
@classmethod | ||
def __substitute(cls, m, uri): | ||
external = uri.startswith('http') | ||
return rf'''<a href="{uri}" class="m-doc dox-injected{' dox-external' if external else ''}"{' target="_blank"' if external else ''}>{m[0]}</a>''' | ||
return rf'''<a href="{uri}" class="m-doc poxy-injected{' poxy-external' if external else ''}"{' target="_blank"' if external else ''}>{m[0]}</a>''' | ||
|
||
def __call__(self, doc, context): | ||
if doc.article_content is None: | ||
|
@@ -589,9 +589,9 @@ def __call__(self, doc, context): | |
for expr, uri in context.autolinks: | ||
if ((not link.has_attr('href') or link['href'] != uri) and expr.fullmatch(s)): | ||
link['href'] = uri | ||
soup.set_class(link, ['m-doc', 'dox-injected']) | ||
soup.set_class(link, ['m-doc', 'poxy-injected']) | ||
if uri.startswith('http'): | ||
soup.add_class(link, 'dox-external') | ||
soup.add_class(link, 'poxy-external') | ||
done = True | ||
changed = True | ||
break | ||
|
@@ -645,7 +645,7 @@ def __call__(self, doc, context): | |
if 'target' not in anchor.attrs or anchor['target'] != '_blank': | ||
anchor['target'] = '_blank' | ||
changed = True | ||
changed = soup.add_class(anchor, 'dox-external') or changed | ||
changed = soup.add_class(anchor, 'poxy-external') or changed | ||
|
||
# do magic with godbolt.org links | ||
if self.__godbolt.fullmatch(href): | ||
|
This file contains 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,11 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
# This file is a part of marzer/dox and is subject to the the terms of the MIT license. | ||
# This file is a part of marzer/poxy and is subject to the the terms of the MIT license. | ||
# Copyright (c) Mark Gillard <[email protected]> | ||
# See https://github.com/marzer/dox/blob/master/LICENSE for the full license text. | ||
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text. | ||
# SPDX-License-Identifier: MIT | ||
|
||
try: | ||
from dox.utils import * | ||
from poxy.utils import * | ||
except: | ||
from utils import * | ||
|
||
|
@@ -84,8 +84,8 @@ class _Defaults(object): | |
r'DOXYGEN' : 1, | ||
r'__DOXYGEN__' : 1, | ||
r'__doxygen__' : 1, | ||
r'__DOX__' : 1, | ||
r'__dox__' : 1, | ||
r'__POXY__' : 1, | ||
r'__poxy__' : 1, | ||
r'__has_include(...)' : 0, | ||
r'__has_attribute(...)' : 0, | ||
r'__has_cpp_attribute(...)' : 999999, | ||
|
@@ -510,7 +510,7 @@ class _Defaults(object): | |
} | ||
navbar = [r'files', r'groups', r'namespaces', r'classes'] | ||
aliases = { | ||
# dox | ||
# poxy | ||
r'cpp' : r'@code{.cpp}', | ||
r'ecpp' : r'@endcode', | ||
r'endcpp' : r'@endcode', | ||
|
@@ -907,12 +907,10 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
if 1: | ||
|
||
# environment | ||
self.this_dir = Path(__file__).resolve().parent | ||
self.verbose_value(r'Context.this_dir', self.this_dir) | ||
self.data_dir = Path(self.this_dir, 'data') | ||
self.package_dir = Path(__file__).resolve().parent | ||
self.verbose_value(r'Context.package_dir', self.package_dir) | ||
self.data_dir = Path(self.package_dir, r'data') | ||
self.verbose_value(r'Context.data_dir', self.data_dir) | ||
self.dox_dir = self.this_dir.parent | ||
self.verbose_value(r'Context.dox_dir', self.dox_dir) | ||
if output_dir is None: | ||
output_dir = Path.cwd() | ||
if not isinstance(output_dir, Path): | ||
|
@@ -942,8 +940,8 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
self.config_path = Path(str(config_path) + ".toml") | ||
elif config_path.is_dir(): | ||
input_dir = config_path | ||
if Path(config_path, 'dox.toml').exists(): | ||
self.config_path = Path(config_path, 'dox.toml') | ||
if Path(config_path, 'poxy.toml').exists(): | ||
self.config_path = Path(config_path, 'poxy.toml') | ||
elif Path(config_path, 'Doxyfile-mcss').exists(): | ||
self.doxyfile_path = Path(config_path, 'Doxyfile-mcss') | ||
elif Path(config_path, 'Doxyfile').exists(): | ||
|
@@ -954,8 +952,8 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
elif self.doxyfile_path is not None: | ||
input_dir = self.doxyfile_path.parent | ||
if input_dir is not None: | ||
if self.config_path is None and Path(input_dir, 'dox.toml').exists(): | ||
self.config_path = Path(input_dir, 'dox.toml') | ||
if self.config_path is None and Path(input_dir, 'poxy.toml').exists(): | ||
self.config_path = Path(input_dir, 'poxy.toml') | ||
if self.doxyfile_path is None and Path(input_dir, 'Doxyfile-mcss').exists(): | ||
self.doxyfile_path = Path(input_dir, 'Doxyfile-mcss') | ||
if self.doxyfile_path is None: | ||
|
@@ -981,7 +979,7 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
|
||
# m.css | ||
if mcss_dir is None: | ||
mcss_dir = Path(self.dox_dir, 'external/mcss') | ||
mcss_dir = Path(self.data_dir, r'mcss') | ||
if not isinstance(mcss_dir, Path): | ||
mcss_dir = Path(str(mcss_dir)) | ||
mcss_dir = mcss_dir.resolve() | ||
|
@@ -1027,12 +1025,12 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
badge = re.sub(r'(?:[.]0+)+$', '', spdx.lower()) # trailing .0, .0.0 etc | ||
badge = badge.strip(' \t-._:') # leading + trailing junk | ||
badge = re.sub(r'[:;!@#$%^&*\\|/,.<>?`~\[\]{}()_+\-= \t]+', '_', badge) # internal junk | ||
badge = Path(self.data_dir, rf'dox-badge-license-{badge}.svg') | ||
self.verbose(rf'Matching license {spdx} against badge file {badge.name}...') | ||
badge = Path(self.data_dir, rf'poxy-badge-license-{badge}.svg') | ||
self.verbose(rf"Finding badge SVG for license '{spdx}'...") | ||
if badge.exists(): | ||
self.verbose(rf'Badge file found at {badge}') | ||
extra_files.append(badge) | ||
badges.append((self.license[r'spdx'], badge.spdx, self.license[r'uri'])) | ||
badges.append((spdx, badge.name, uri)) | ||
self.verbose_value(r'Context.license', self.license) | ||
|
||
# project repo access level | ||
|
@@ -1070,7 +1068,7 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
else: | ||
raise Exception(rf"cpp: '{config['cpp']}' is not a valid cpp standard version") | ||
self.verbose_value(r'Context.cpp', self.cpp) | ||
badge = rf'dox-badge-c++{str(self.cpp)[2:]}.svg' | ||
badge = rf'poxy-badge-c++{str(self.cpp)[2:]}.svg' | ||
badges.append((rf'C++{str(self.cpp)[2:]}', badge, r'https://en.cppreference.com/w/cpp/compiler_support')) | ||
extra_files.append(Path(self.data_dir, badge)) | ||
|
||
|
@@ -1292,9 +1290,9 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir, | |
extra_files.append(Path(file)) | ||
|
||
# add built-ins to extra files | ||
extra_files.append(Path(self.data_dir, r'dox.css')) | ||
extra_files.append(Path(self.data_dir, r'dox.js')) | ||
extra_files.append(Path(self.data_dir, r'dox-github-icon.png')) | ||
extra_files.append(Path(self.data_dir, r'poxy.css')) | ||
extra_files.append(Path(self.data_dir, r'poxy.js')) | ||
extra_files.append(Path(self.data_dir, r'poxy-github-icon.png')) | ||
|
||
# add jquery | ||
self.jquery = Path(self.data_dir, r'jquery-3.6.0.slim.min.js') | ||
|
Oops, something went wrong.