Implementation changes and extensions
- Enlarged view area for DEBUG output
- Extended debug view content
- Html frame based on assets file index.html
- Enabled script execution and pure text transfer
- Added assets loader for javascript and css files
Added functionality (flexmark extensions):
- SubscriptExtension instead of StrikethroughExtension (subscript not working with strikethrough)
- SuperscriptExtension
- TocExtension
- GitlabExtension with Mermaid and Katex support
- AdmonitionExtension
- enabled checkboxes in TaskListExtension
Hi Tiim, I want to use this nice widget for my own purpose but the functionality should be extended. Treat this request as proposal how things could be done (see the commit message). Thanks Mick2nd
Hi Tiim, I do not know, if You got this info. In the mean time I detected that my PR was not fully working. Especially the widgets themselves did not render. But I worked hard to find a solution for this problem and I found one. I will create a new PR with the newest changes soon. I believe the main disadvantage of my solution (in the PR) is the memory consumption. This must definitely be optimized. Thanks Mick2nd
My first commit was buggy so that the widgets were not displayed properly. The most important change is the bug fix.
Sample Screenshot with a table, a diagram and a math formula
Improvements Overview
- Flexmark Parser extensions and improvements
- Use Subscript and Superscript extensions instead of Strikethrough as Strikethrough does not include Subscript (tested).
- Configure Tables extension, for instance with html class attribute.
- Style Tables, see
default.cssin assets folder. - Add TOC (Table Of Contents) extension.
- Equip with class attribute for further use in CSS.
- Equip Task List extension with class attribute.
- Make Task items enabled (not grayed out)
- Add Admonition extension, added CSS and JS to
index.htmlfor styling. - Add GitLab extension.
- Katex - CSS and JS library added
- Mermaid - CSS and JS library added to assets folder and included in
index.html.
- Add Code Highlighting by including CSS and JS. Code Fences with language specification like
pythonare recognized and and highlighted. A selection of the most common languages was done.
- Web page source code, CSS files, JS files are now located in the
assetsfolder. They are loaded in WebView from there using aassetLoader.shouldInterceptRequestAPI.- The Asset Loader supports loading from asset folder and from a user defined global folder like the
Documentsfolder. - A user defined
userstyle.cssfile can be used to fine-tune CSS settings. - The user must grant permission to an user selected folder where the CSS file resides.
- The Quotes blocks are stylized by CSS (Styles from the Internet).
- App wide Zoom setting prepared.
- The Asset Loader supports loading from asset folder and from a user defined global folder like the
- The markdown parser is further equipped by a preparser. It is responsible for transforming the Math delimiters as used by Joplin into the Flexmark compatible ones.
- The application is equipped now with the Hilt DI framework, provided by Google.
- Add Unit Tests. Full test of markdown parser.
Bugs
-
FileContentObserver,PackageReplacedReceiver,UpdateServicenot working. They are intended to recognize changes of theuserstyle.cssfile and update the widgets accordingly. - Some settings should be made configurable like Zoom, usage of userstyle.css etc.
Further Progress
In the mean time I made further progress:
- The widget can now load md pages from the Internet or another http / https server
- The Image View was replaced by a List View thus enabling scroll behavior. The bitmaps are divided into stripes serving as list view items.
- The Main Activity was widely extended, it has now 4 Fragments:
- The Main fragment with the former link and statement
- A Configure fragment containing configuration options and the former Debug sample area
- An Editor fragment. The Main Activity can be configured as Intent target and serves as little editor.
- A Preview fragment displaying the rendered markdown
Surely, there needs to be done some fine tuning. But the main functionality works in principal.