Skip to content

Commit

Permalink
renamed project to 'poxy'
Browse files Browse the repository at this point in the history
also:
- made it installable!
  • Loading branch information
marzer committed Apr 25, 2021
1 parent 408df59 commit bc67a66
Show file tree
Hide file tree
Showing 39 changed files with 182 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
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.
2 changes: 2 additions & 0 deletions README.md
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/).
9 changes: 5 additions & 4 deletions __main__.py
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 <mark.gillard@outlook.com.au>
# 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()
7 changes: 0 additions & 7 deletions dox/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions dox/__main__.py

This file was deleted.

7 changes: 7 additions & 0 deletions poxy/__init__.py
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 <mark.gillard@outlook.com.au>
# See https://github.com/marzer/poxy/blob/master/LICENSE for the full license text.
# SPDX-License-Identifier: MIT

from .run import run, main
13 changes: 13 additions & 0 deletions poxy/__main__.py
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 <mark.gillard@outlook.com.au>
# 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.
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
41 changes: 3 additions & 38 deletions dox/data/dox.css → poxy/data/poxy.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ article section.m-doc-details > div > h3:first-child
background-color: #22272e;
}

pre, code, .dox-enable-if > a
pre, code
{
font-family: 'Consolas', 'Source Code Pro', monospace;
}

a.dox-external
a.poxy-external
{
font-weight: normal;
}
Expand All @@ -82,41 +82,6 @@ pre.m-console a:hover
text-decoration: underline !important;
}

.dox-enable-if
{
margin-bottom: 2px;
}

.dox-enable-if > *
{
display: inline-block;
border-radius: 0.2rem;
background-clip: padding-box !important;
padding: 0px 2px;
text-decoration: none;
}

.dox-enable-if > a
{
white-space: nowrap;
font-size: 0.7rem;
font-weight: bold;
background-color: #858585;
color: #050505;
}

.dox-enable-if > a:hover
{
background-color: #747474;
color: initial;
}

.dox-enable-if > span
{
display: none;
padding-left: 2em;
}

@media screen and (min-width: 576px)
{
nav .m-thin
Expand All @@ -127,7 +92,7 @@ pre.m-console a:hover
nav .github
{
padding-left: 44px !important;
background-image: url("dox-github-icon.png");
background-image: url("poxy-github-icon.png");
background-repeat: no-repeat;
background-size: 25px 25px;
background-position: -30px center;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions dox/doxygen.py → poxy/doxygen.py
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 <mark.gillard@outlook.com.au>
# 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 *

Expand Down
20 changes: 10 additions & 10 deletions dox/fixers.py → poxy/fixers.py
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 <mark.gillard@outlook.com.au>
# 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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(' ')
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down
44 changes: 21 additions & 23 deletions dox/project.py → poxy/project.py
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 <mark.gillard@outlook.com.au>
# 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 *

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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():
Expand All @@ -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:
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -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')
Expand Down
Loading

0 comments on commit bc67a66

Please sign in to comment.