From 80437f6b2bf1765a9f14d3c9bd44de0b473cb232 Mon Sep 17 00:00:00 2001 From: vicky Date: Tue, 7 Jun 2022 23:58:20 +0200 Subject: [PATCH] V1.0 --- README.md | 42 +++++++++++++++++++-- example_userfiles/_table | 5 --- example_userfiles/configs/website.yaml | 0 setup.cfg | 2 +- src/bootstraparse/configs/parser_config.yml | 2 +- src/bootstraparse/modules/context_mngr.py | 2 +- src/bootstraparse/modules/error_mngr.py | 2 +- src/bootstraparse/modules/export.py | 2 +- src/bootstraparse/modules/syntax.py | 4 +- src/bootstraparse/templates/bootstrap.yml | 2 + workflow-documents/regexps.txt | 29 -------------- workflow-documents/specs.yaml | 2 +- 12 files changed, 49 insertions(+), 45 deletions(-) delete mode 100644 example_userfiles/_table delete mode 100644 example_userfiles/configs/website.yaml delete mode 100644 workflow-documents/regexps.txt diff --git a/README.md b/README.md index aa132ab..cf3d1ce 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,43 @@ # bootstraparse -Bootstraparse is a personal project started with a specific goal in mind: creating static html pages for direct display from a markdown-like file. -Bootstraparse aims to be customisable in that regard, but its first iteration and main focus will be to create a bootstrap-powered html. +bootstraparse is a personal project started with a specific goal in mind: creating static html pages for direct display from a markdown-like file. +bootstraparse aims to be customisable in that regard, but its first iteration and main focus will be to create a bootstrap-powered html. -Refer to the `example_userfiles` for an idea of what the parser expects you to feed it and `example_website` for the generated result. + +You can refer to the `example_userfiles` for an idea of what the parser expects you to feed it and find an example of our automated generation at https://idle-org.github.io/bootstraparse/ for this particular folder. Or you can run the program yourself for the same result! [![Python application](https://github.com/idle-org/bootstraparse/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/idle-org/bootstraparse/actions/workflows/python-app.yml) + +--- +## Roadmap +### V1.0.1 +- Make the default example site way more useful +- Add the type and return types of all functions +- Add documentation to remaining lone functions +- Write a documentation for the application (use specs.yaml) + +### V1.0.3 +- Copy un-parsable files to destination folder without modifications +- Add copy behaviour to config file + +### V1.1 +- Functioning `table` Token +- Functioning `code` Token +- Establish a list of all configurable parameters to implement in the future, and update the roadmap with them. +- Decide level of logic to be implemented, and whether it should be configurable +- Update the uses of remaining files + + +### V1.2 +- Check error messages and add a real debug level to parameters +- Functioning `blockquote` Token +- Remove old regex usage + +### V1.3 +- Add advanced lookahead logic for `*` + +### V1.4 +- Add html indentation for human readability of the output. + +### V2 +- Add a functioning post-context enhancer able to generate menus and elements from arbitrary logic. +- Achieve perfect markdown compatibility with appropriate config parameters \ No newline at end of file diff --git a/example_userfiles/_table b/example_userfiles/_table deleted file mode 100644 index 2bac0b5..0000000 --- a/example_userfiles/_table +++ /dev/null @@ -1,5 +0,0 @@ -| First header | Second Header | Third header | -|--------------|-------:-------|-------------:| -| First tab | Second tab | third tab | -|2 Big tab like very very big | Third bab | -| Babada |2 Very big babada | {class= bigtable} #[skip,3,44,number=33] \ No newline at end of file diff --git a/example_userfiles/configs/website.yaml b/example_userfiles/configs/website.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/setup.cfg b/setup.cfg index c45422e..57f3f5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ name = bootstraparse description = A custom markdown parser for Bootstrap & Python author = Vkyfox -version = 0.1 +version = 1.0 license = Mozilla Public License Version 2.0 license_file = LICENSE platforms = unix, linux, osx, cygwin, win32 diff --git a/src/bootstraparse/configs/parser_config.yml b/src/bootstraparse/configs/parser_config.yml index fec515f..d6899af 100644 --- a/src/bootstraparse/configs/parser_config.yml +++ b/src/bootstraparse/configs/parser_config.yml @@ -2,7 +2,7 @@ global: template: "bootstrap.yml" output: "example_site/" bootstrap_version: "3.3.7" - version: "0.0.1" + version: "1.0.0" bootstrap_location: "" logging: diff --git a/src/bootstraparse/modules/context_mngr.py b/src/bootstraparse/modules/context_mngr.py index e3ceb0e..a64d3fb 100644 --- a/src/bootstraparse/modules/context_mngr.py +++ b/src/bootstraparse/modules/context_mngr.py @@ -490,7 +490,7 @@ class ContextManager: raise MismatchedContainerError(token) except MismatchedContainerError as e: - error_mngr.log_exception(e, level="CRITICAL") # FUTURE: Be more specific. + error_mngr.log_exception(e, level="CRITICAL") # FUTURE: Try to guess some hints. index += 1 self.contextualised = True diff --git a/src/bootstraparse/modules/error_mngr.py b/src/bootstraparse/modules/error_mngr.py index 9b446d2..83eed01 100644 --- a/src/bootstraparse/modules/error_mngr.py +++ b/src/bootstraparse/modules/error_mngr.py @@ -153,7 +153,7 @@ class MismatchedContainerError(BootstraparseError): """ The token is not final and cannot be contained. Indicative of a mismatched token. """ - def __init__(self, token): # FUTURE : Add file name to error + def __init__(self, token): self.token = token if token: self.line = token.line_number diff --git a/src/bootstraparse/modules/export.py b/src/bootstraparse/modules/export.py index 2fa2fa0..d17de30 100644 --- a/src/bootstraparse/modules/export.py +++ b/src/bootstraparse/modules/export.py @@ -111,7 +111,7 @@ class ExportManager: level='CRITICAL' ) # future: allow for template selection - optionals = format_optionals(export_request.optionals) # FUTURE : More Extensive testing + optionals = format_optionals(export_request.optionals) return start, end, optionals diff --git a/src/bootstraparse/modules/syntax.py b/src/bootstraparse/modules/syntax.py index a3bdee8..40654d8 100644 --- a/src/bootstraparse/modules/syntax.py +++ b/src/bootstraparse/modules/syntax.py @@ -6,7 +6,7 @@ # from bootstraparse.modules.syntax import line # line.parse_line('string') # returns a List of tokens # line_to_replace.parse_line('string') # returns a List of tokens parsed for replacements -# imports.parse_line('string', True) # returns a List of tokens parsed for imports # FUTURE: Not implemented yet +# imports.parse_line('string', True) # returns a List of tokens parsed for imports # any_token.create_diagram("filename") # Debugging import os @@ -347,7 +347,7 @@ def reparse(parse_element): :return: returns a function parsing given match with specified parsing element """ def _reparse(__, _, tokens): - return parse_element.parseString(tokens[0]) # Future: fix this with a proper solution + return parse_element.parseString(tokens[0]) # Future: document this behaviour more in-depth return _reparse diff --git a/src/bootstraparse/templates/bootstrap.yml b/src/bootstraparse/templates/bootstrap.yml index 005c509..86350c5 100644 --- a/src/bootstraparse/templates/bootstrap.yml +++ b/src/bootstraparse/templates/bootstrap.yml @@ -22,6 +22,8 @@ inline_elements: oneline_elements: ulist: ["", ""] olist: ["", ""] + # future: blockquote + # future: code list_line: ["", ""] table: diff --git a/workflow-documents/regexps.txt b/workflow-documents/regexps.txt deleted file mode 100644 index b777626..0000000 --- a/workflow-documents/regexps.txt +++ /dev/null @@ -1,29 +0,0 @@ -Pre-parser: (add one linebreak at the end of the file?) -::< include > -:: < [\w\-\.]+ > - - - -Parser: -*em* - \*{1}[\w ;,'"\-\.\^\$\+\?\{\}\[\]\\\|\(\)]+\*{1} - -**strong** - \*{2}[\w ;,'"\-\.\^\$\+\?\{\}\[\]\\\|\(\)]+\*{2} - -# p1 -#{1} ^[\w ;,'"\-\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+\s - -^lead paragraph^ -\^[\w ;,'"\-\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+\^ - -## p3 -#{2} ^[\w ;,'"\-\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+\s - -~~ div -~~ [\w\-\.]+\s - - div ~~ -[\w\-\.]+ ~~ - -(#1)texttexttext(#1) \ No newline at end of file diff --git a/workflow-documents/specs.yaml b/workflow-documents/specs.yaml index 531be6c..e0ee9a7 100644 --- a/workflow-documents/specs.yaml +++ b/workflow-documents/specs.yaml @@ -76,7 +76,7 @@ display: type: one-line scope: first release -# Not sure about sublists for the moment, add that later +# future: add sublists numbered lists: bpr: '#. nbd list item' markdown compatible: no