Team DevLog Holzchopf - Update 2021/02/17

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
Wow, already a month went by. Here is a short update on what I am doing. @Phil7 and @Holzchopf can do similar if they want to.

Well, of course! Here we are. I start a new thread, to keep your dev log tidy ;)

As you might have read, I am currently working on a VS Code extension for Cerberus X. What I have so far:
- syntax highlighting
- document outline
- rudimentary in-editor help panel

See for yourself:
20200625-vscode_outline.png


It's not yet usable, as there's no build option yet. But you know, the whole thing started as an experiment and my primary focus was on whether an extension could provide an outline and in-editor help panel. Latter isn't nice to look at yet (and turned out to be a massive pain in the rear thanks to (valid) security restrictions), but you can tell that a proper VS Code extension for Cerberus X is in its making.
 
Last edited:

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
I am already in love. Can't wait to get my hands on it. But please don't rush.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
In-Editor Help

This is everything but straight-forward. The vscode.Webview is quite restrictive; html+css is rendered correctly except for images, external links open in a new (standard) browser window, internal links to #anchors don't work at all. Also, there's no navigation panel. For links to work (i.e. open a new page), they have to call a JavaScript function which tells the extension to load a new page, which then again does that work and provides the new html source. Great. I saw myself confronted with two options:
  1. Try parsing the existing generated .html files, replace links with those function calls, replace image resources with the correct VSCode-scheme-URI, replace the existing header with one that provides a navigation.
  2. Let Makedocs spit out a more easily readable format - a decl.json containing all DocDecls - and build the contents from that.

Both methods have their pros and cons. I went down path 2 because I was too scared of parsing .html which might change and then break the parsing. Of course this means I have to transform Markdown in docs again, which wouldn't be too much of a hassle if all the Markdown was standard Markdown (I guess I'd find some existing Markdown to HTML transformer).... Also this method will break syntax-highlighting in code blocks. It could be implemented again, but for now I see things that have higher priority. Lastly this method will ignore custom global style rules like the multicolumn class, but if there's only one of them, I might even just copy that into my template. Speaking of styles, this method allows to style everything according to the currently set VSCode theme, which is nice.

So where am I now?

20200701-vscode_documentation.png


  1. A navigation panel (not fully functional now)
  2. The main menu is part of the .html documentation templates - There would be ways of extracting it from there, but for now I just hard-coded it. I'll adapt it to what @Phil7 will present us with
  3. Declaration-targeting links work. They're resolved by Makedocs directly as these resolving rules are soooo complicated*. External links work too, naturally. Anchor-links don't work yet

* just to give you a hint of what Makedocs has to deal with when resolving a link: [[Create]] might be targeting a document or any declared identifier (function, method, class, module...). How should it now? It doesn't. It first looks in the current scope (module or class depending on where the decl containing that link sits), then it looks in all imported modules, then it looks in the global scope, which possibly even finds it in documents.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
I am all for moving to a standard format. Rich provided a conversion tool, so we could settle for .md for all the official stuff.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
I just had the following idea: Instead of passing raw .cerberusdoc content to the extension, I could parse the markdown directly within Makedocs and put the result in the output .json - then we'd only have one tool that has to deal with this kind of markdown, namely Makedocs. This way the generated html does not change when templates change and also if we ever change the markdown format it will only be Makedocs that has to be updated.

I'll try that now and report back.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
Uuuhh I promised to report back, but I never did :oops:

Makedocs now generates that one big .json file containing all docs. Works "flawlessly". I put that in quotation marks because there's one nasty flaw: brl.markdown doesn't always generate valid html and different user agents seem to render the generated, broken html differently. No game stopping thing, it mostly happens in lists (seems they're not terminated correctly) - I only noticed, because the landing page looked different.

20200812-reference-docs.png


(notice the margins between some list points)

20200812-vscode-docs.png
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
HOME HOME HOME :)

But it is great to see the progress. Thank you
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
Just a quick update: I'm still working on it. Some weeks ago I gave few people access to the repo so they could test it. Apparently it's not running right now. I will look into that and I will definitely continue my work, with focus on building so it could already be somewhat used for productive work. But (!) right now, work for my company is plenty as a big project's deadline is approaching. So for the last 4 weeks I couldn't work on it and I think I won't be able to pick up work before February 2021.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
These times... So I managed to pack an early alpha. It's attached. Many things don't run yet, unfortunately. But I ask you to test the following:

  1. Install the vsix (Extensions > ... > Install from VSIX), open a .cxs file of your choice.
  2. A popup will appear telling you the Cerberus X Path hasn't been set. Click 'Set Path' and select your Cerberus X installation path.
  3. Try the commands (from the command prompt CTRL+SHIFT+P) 'Cerberus X: Build as HTML5 application' and 'Cerberus X: Run as HTML5 application'
Please report any Errors that occur along the way. Or even if all these steps worked. You can also glimpse at the Cerberus X documentation, but they're not fully functional yet.

Cheers!
 

Attachments

  • cerberus-x-0.1.0.zip
    38.1 KB · Views: 26

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
Good job so far. What I noticed:

  1. You need to build the app first. Run doesn't include building.
  2. After building, I have to click inside the source code, or I will get an error message:

    1607022305638.png
  3. Yes, the docs display is rather not pretty.
  4. No F1 help.
 

Pierrou

Active member
Joined
Jul 6, 2017
Messages
186
It builds and runs when testing with Bouncy Aliens

One of my own files looks like this :
1607064996680.png
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
One of my own files looks like this :
I noticed that too, but I think it is because of VSCode still analysing the Decls file. Not sure. After a restart of VSC, it looked fine.
Or do you have, by any chance a different Cerberus extension installed too?
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
320
This is so cool! Thanks for making that! :)
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
Thanks for your reports! @MikeHart concerning the docs display, since there are multiple aspects to consider:
  • The docs are themed with the current vscode theme colors. I tried to always take pairs of --XXX-front and --XXX-background colors, hoping all would be legible. If that's somewhere not the case, can you post a screenshot of how they look?
  • Some features simply don't work in the webview vscode provides (for security reasons), breaking some of the pages (simply meaning: there's stuff that won't be loaded and the page might look relatively blank). Are there sites/docs that are completely messed up?
  • Yes, the "one page per declaration" thing is new and might irritate at first. It was the quickest to implement. But I plan to also provide a nice overview page (something a bit nicer than this plain table). Is it maybe that what you consider "rather not pretty"? =)
  • All in all, I am experimenting a lot with the docs layout there. Wishes are welcome, although I can't promise they'll be respected in full ;)

The F1 thing is definitely on my to do list!

@Pierrou that seems to be an error in my syntax definitions... I haven't considered preprocessor directives with string values :rolleyes:
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
484
Tiny update (although the file size increased by an unholy amount compared to the actual changes :unsure: )

Changelog:

Fixed
  • Syntax highlighting for precompiler directives
Changed
  • Run as HTML5 now also builds
 

Attachments

  • cerberus-x-0.1.1.zip
    76.6 KB · Views: 10
Top Bottom