This commit is contained in:
vicky 2022-06-07 23:58:20 +02:00
parent 98e86d2626
commit 80437f6b2b
No known key found for this signature in database
GPG Key ID: AA04A65592395BB8
12 changed files with 49 additions and 45 deletions

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -22,6 +22,8 @@ inline_elements:
oneline_elements:
ulist: ["<ul{optionals}>", "</ul>"]
olist: ["<ol{optionals}>", "</ol>"]
# future: blockquote
# future: code
list_line: ["<li{optionals}>", "</li>"]
table:

View File

@ -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)

View File

@ -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