Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes to code snippets
Codemirror 5 is no longer maintained. Upgrades project to use Codemirror 6 which fixes copying code snippets and has better support for mobile browsers.
Adds a copy button to code snippets.
Broken playground functionality was removed and replaced with a "Try it..." button that opens code snippet with official playground at https://play.vlang.io.
Build tool (main.v)
Project was using deprecated sassc binary. Removed the SASS build step and dependency. CSS was consolidated as part of the css cleanup.
The index of section names and files now is stored in the same
v-doc.js
under the docs object, instead of a a separate js file.JS
JS code was refactored and consolidated in
v-doc.js
.The object
vdocs
acts as a namespace for all related code.vdocs.examples
handles all the code snippets.vdocs.search
has all the search related code.vdocs.ui
hydrates the UI and handles all UI interactions.Codemirror code was separated from the docs code. The file "cm-lang-v.js" implements a CM 6 Language Mode for V-Lang in vanilla JS and should be reusable in any website.
CSS
Consolidated all css, Codemirror specific styles are in "v-docs-cm-theme.css" all other css is in "docs.css".
Refactored and organized css selectors to have better scoping and improve mobile support. Made minor cosmetic changes to presentation.
HTML
Changes to the structure and layout of the sidebar. Removed unused references to js/css files.
Issues addressed
Issues #11, #7, #7 close search results and #3 were addressed.
To explore
Currently it searches the raw markdown (doc.md), the search results display the raw markdown syntax and it looks bad.
The module
markdown
is using an old version of md4c. Some of the GitHub's markdown is not rendering. Some of this issues can be resolve if the markdown is compiled against a newer md4c.