Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework of HTML publisher. #622

Merged
merged 67 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
4ad0387
Restructured template tests that edit folders in the source tree.
neerdoc Jan 11, 2024
5d3b506
Added test to cover single document with templare.
neerdoc Jan 11, 2024
6e9068f
Test results updated.
neerdoc Jan 11, 2024
19bf36a
Moved document attributes to base.
neerdoc Jan 11, 2024
c2fd3fd
Renamed sidebar.tpl to doorstop.tpl.
neerdoc Jan 15, 2024
1336e43
Removed unused files.
neerdoc Jan 15, 2024
f0b42e7
Added MathJax to repo to allow running html export and server offline.
neerdoc Jan 15, 2024
d4c7a97
Removed dead code.
neerdoc Jan 15, 2024
001c5e7
Restructured html export to follow server setup to allow code reuse.
neerdoc Jan 15, 2024
d7521cb
Added default document properties to html. Fixes #26.
neerdoc Jan 15, 2024
f7bcf67
Code reuse in server to publish the same as html output.
neerdoc Jan 15, 2024
24d61cf
Updated bootstrap and all default sidebar template to a more modern d…
neerdoc Jan 15, 2024
2066b7c
Fixed single document publish.
neerdoc Jan 15, 2024
b7d8f0d
Added a long heading to verify fix of #327
neerdoc Jan 15, 2024
f13c069
Added document properties for REQ and TUT.
neerdoc Jan 15, 2024
2848dac
Removed leftover test fix.
neerdoc Jan 15, 2024
b27673c
Cleaned up.
neerdoc Jan 15, 2024
cb076f6
Updated tests due to restructure of html publishing.
neerdoc Jan 15, 2024
0603a1d
Cleaned up re-run and increased number of attempts.
neerdoc Jan 15, 2024
609f4f1
Added test to cover LaTeX export of single document to path.
neerdoc Jan 17, 2024
4f8d136
Simplified code.
neerdoc Jan 17, 2024
d486849
Moved test case.
neerdoc Jan 17, 2024
6f46f8f
Removed unecessary if branch.
neerdoc Jan 17, 2024
872f448
Removed unecessary try-except.
neerdoc Jan 17, 2024
6928446
Removed dead code.
neerdoc Jan 17, 2024
436429a
Added TOC tests for html.
neerdoc Jan 17, 2024
6b186c2
Added empty template test.
neerdoc Jan 18, 2024
a200f96
Added test of cli __main__ for coverage.
neerdoc Jan 19, 2024
f1f2342
Fixed os independent paths in tests.
neerdoc Jan 19, 2024
d4f8d19
Added debug output for Windows/Linux tests.
neerdoc Jan 19, 2024
51fcb20
Added more debug printout.
neerdoc Jan 19, 2024
3dc9979
Cleaned up.
neerdoc Jan 19, 2024
dffbdc5
Still debugging tests.
neerdoc Jan 19, 2024
44b6fa0
Debug.
neerdoc Jan 19, 2024
1f2d065
Added os independent path separator.
neerdoc Jan 19, 2024
1629730
Problem was numbering of list differs between OSs. Fixed by name check.
neerdoc Jan 19, 2024
d7006bd
Cleaned up.
neerdoc Jan 19, 2024
95cc5ad
Added onerror on removing old test folders.
neerdoc Jan 20, 2024
e793f6d
Added test case for single document pulish to path in markdown format…
neerdoc Jan 22, 2024
39d683e
Added missing TOC in markdown publish.
neerdoc Jan 22, 2024
d69d685
Removed extra space in item links. Fixes #469.
neerdoc Jan 22, 2024
5e66981
Removed unecessary tests and fixed tests for removed extra space.
neerdoc Jan 23, 2024
974b5b4
Removed extra text.
neerdoc Jan 23, 2024
59f5d02
Corrected item tests.
neerdoc Jan 23, 2024
dd10b2f
Blacked.
neerdoc Jan 23, 2024
0f328d4
Removed dead code.
neerdoc Jan 23, 2024
407e0a8
Removed dead code.
neerdoc Jan 23, 2024
8f94bee
Added test to catch main() in server by verifying --version.
neerdoc Jan 23, 2024
da5d6d8
Fixed test to actually return a bad code.
neerdoc Jan 23, 2024
f778c55
Added client tests to increase coverage.
neerdoc Jan 24, 2024
bf9b84d
Added a few integration tests to verify the server api calls. Unfortu…
neerdoc Jan 24, 2024
d559380
Added string to css for easier check of API.
neerdoc Jan 25, 2024
ddcfae9
Fixed bug where document_properties were requested for Items.
neerdoc Jan 25, 2024
3c24368
Fixed json detection bug.
neerdoc Jan 25, 2024
5dc7252
Changed server initialization to allow testing with WebTest-library.
neerdoc Jan 25, 2024
111925b
Added server tests to increase coverage.
neerdoc Jan 25, 2024
58ebb38
Added WebTest as a dev dependency to allow API testing.
neerdoc Jan 25, 2024
d6c0a22
Added API tests.
neerdoc Jan 25, 2024
7ab309c
Removed deprecated pkg_resources.
neerdoc Jan 25, 2024
2ca23b6
Increased version of bottle due to deprecation warning, but need to w…
neerdoc Jan 25, 2024
362e206
Increased poetry version.
neerdoc Jan 25, 2024
ce58564
Updated poetry.lock
neerdoc Jan 25, 2024
60bbb14
Updated version numbers for make doctor.
neerdoc Jan 25, 2024
8fcef2c
Removed unecessary ignore.
neerdoc Jan 25, 2024
84aeeb0
Added diff-cover as a development dependency to allow easy check of c…
neerdoc Jan 25, 2024
6834d6a
Added 'make test-cover' to allow easy compare of coverage before push…
neerdoc Jan 25, 2024
aabbe88
Added new file to test import of doorstop when not installed.
neerdoc Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ exclude_lines =
pragma: no cover
raise NotImplementedError
except DistributionNotFound
if __name__ == '__main__'

skip_covered = true
12 changes: 1 addition & 11 deletions .github/workflows/execute-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,8 @@ jobs:
with:
command: make test
current_path: ${{ inputs.workpath }}
attempt_limit: 3
attempt_limit: 5
attempt_delay: 2000

# - name: Run tests attempt 1
# run: make test
# - name: Run tests attempt 2
# if: ${{ failure() }}
# run: make test
# - name: Run tests attempt 3
# if: ${{ failure() }}
# run: make test

- name: Upload coverage
uses: codecov/codecov-action@v1
if: ${{ inputs.os == 'ubuntu-latest' && matrix.python-version == '3.9' && github.repository == 'doorstop-dev/doorstop' }}
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python 3.8.13
poetry 1.6.1
poetry 1.7.1
4 changes: 2 additions & 2 deletions .verchew.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ version = 3.8 || 3.9 || 3.10 || 3.11 || 3.12
[Poetry]

cli = poetry
version = 1
version = 1.7

[Graphviz]

cli = dot
cli_version_arg = -V
version = 7
version = 9
optional = true
message = This is only needed to generate UML diagrams for documentation.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Clean everything:
$ make clean
```

Compare coverage to current `develop` branch to see if changes causes reduced coverage.
Please run before creating a PR.
```sh
$ make test-cover
```

## Automatic

Keep all of the above tasks running on change:
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ ifndef DISABLE_COVERAGE
poetry run coveragespace update overall
endif

.PHONY: test-cover
test-cover: install
# Run first to generate coverage data current code.
TEST_INTEGRATION=true poetry run pytest doorstop --doctest-modules --cov=doorstop --cov-report=xml --cov-report=term-missing
# Run second to generate coverage data for the code in the develop branch.
TEST_INTEGRATION=true diff-cover ./coverage.xml --compare-branch=$(shell git for-each-ref --sort=-committerdate refs/heads/develop | cut -f 1 -d ' ')

.PHONY: read-coverage
read-coverage:
bin/open htmlcov/index.html
Expand Down
6 changes: 3 additions & 3 deletions doorstop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""Package for doorstop."""

from pkg_resources import DistributionNotFound, get_distribution
from importlib.metadata import PackageNotFoundError, version

from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
from doorstop.core import (
Expand All @@ -22,8 +22,8 @@
__project__ = "Doorstop"

try:
__version__ = get_distribution(__project__).version
except DistributionNotFound:
__version__ = version(__project__)
except PackageNotFoundError:
__version__ = "(local)"

CLI = "doorstop"
Expand Down
7 changes: 2 additions & 5 deletions doorstop/cli/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,12 @@ def test_publish_document_markdown_file(self):
self.assertIs(None, main(["publish", "req", path]))
self.assertTrue(os.path.isfile(path))

def test_publish_document_html(self):
"""Verify 'doorstop publish' can create HTML output."""
self.assertIs(None, main(["publish", "hlt", "--html"]))

def test_publish_document_html_file(self):
"""Verify 'doorstop publish' can create an HTML file."""
path = os.path.join(self.temp, "req.html")
self.assertIs(None, main(["publish", "req", path]))
self.assertTrue(os.path.isfile(path))
filePath = os.path.join(self.temp, "documents", "req.html")
self.assertTrue(os.path.isfile(filePath))

def test_publish_tree_html(self):
"""Verify 'doorstop publish' can create an HTML directory."""
Expand Down
12 changes: 12 additions & 0 deletions doorstop/cli/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

"""Unit tests for the doorstop.cli.main module."""

import importlib.util
import sys
from os import sep
from unittest.mock import Mock, patch

from doorstop import settings
Expand Down Expand Up @@ -72,3 +75,12 @@ def test_options(self):
self.assertFalse(settings.CACHE_PATHS)
self.assertTrue(settings.WARN_ALL)
self.assertTrue(settings.ERROR_ALL)

def test_main(self):
testargs = [sep.join(["doorstop", "cli", "main.py"])]
with patch.object(sys, "argv", testargs):
spec = importlib.util.spec_from_file_location("__main__", testargs[0])
runpy = importlib.util.module_from_spec(spec)
spec.loader.exec_module(runpy)
# Assert
self.assertIsNotNone(runpy)
118 changes: 0 additions & 118 deletions doorstop/core/files/templates/doorstop.css

This file was deleted.

7 changes: 7 additions & 0 deletions doorstop/core/files/templates/html/bootstrap.bundle.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions doorstop/core/files/templates/html/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions doorstop/core/files/templates/html/bootstrap.min.js

This file was deleted.

7 changes: 7 additions & 0 deletions doorstop/core/files/templates/html/doorstop.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Doorstop.css file. */
.caption {
text-align: center;
font-size:15px;
}

#img {width: 100%}
6 changes: 3 additions & 3 deletions doorstop/core/files/templates/html/general.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
body {
padding-left: 20px;
padding-top: 20px;
padding-right: 20px;
padding-left: 0px;
padding-top: 0px;
padding-right: 0px;
}

/* indent everything within a section */
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doorstop/core/files/templates/html/output/chtml.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions doorstop/core/files/templates/html/output/svg.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doorstop/core/files/templates/html/output/svg/fonts/tex.js

Large diffs are not rendered by default.

71 changes: 0 additions & 71 deletions doorstop/core/files/templates/html/sidebar.css

This file was deleted.

1 change: 1 addition & 0 deletions doorstop/core/files/templates/html/tex-mml-chtml.js

Large diffs are not rendered by default.

Loading
Loading