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

Update to Codemirror 6 #19

Merged
merged 11 commits into from
Dec 14, 2024
Merged

Update to Codemirror 6 #19

merged 11 commits into from
Dec 14, 2024

Conversation

ctkjose
Copy link

@ctkjose ctkjose commented Dec 14, 2024

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.

…examples` handles all the code snippets. `vdocs.search` has all the search related code. `vdocs.ui` hydrates the UI and handles all UI interactions.
…. SASS was only used for bundling. Project already using modern CSS Variables for themes.
…names and files is stored in the same `v-doc.js` file instead of a separate file. Items are stored under the `vdocs` namespace instead of global variables.
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit e4b636f into vlang:generator Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants