News
Natural Docs 2.3 Development Release 1: Dark Themes
June 23rd, 2022

Time to start a new batch of development releases.  What do we have so far?

Dark Themes

I originally planned on doing some easy, low-hanging fruit features while I worked on SystemVerilog.  Adding dark themes turned out to be a bigger effort than I thought, but I'm pretty happy with the results:

These aren't just additional styles you can choose when you build your documentation.  If you use the default style you get all three themes and you can switch between them from the browser.  Just click the moon icon next to the search box:

The dark theme is what you expect, plus there's a black theme that's higher contrast.  You can give them a look here.

  • How do I apply this to my project?
    Just download the latest development release and run it on your project.

  • What if I have a custom style?
    All your existing CSS should apply to the light theme with no changes.  The dark and black themes will just recolor it.

  • Can I customize the other themes too?
    Sure, just add additional CSS rules with .DarkTheme and .BlackTheme ahead of them.  So in addition to styling ".SHComment" you would also style ".DarkTheme .SHComment" and ".BlackTheme .SHComment".

  • Can I disable the other themes?
    If you're not using a custom style, choose Light as the style in Project.txt or on the command line.  If you have a custom style based on Style.txt, edit it to inherit from Light instead of Default.  If you just use a CSS file as a style, add "#NDThemeSwitcher { display: none !important; }".

  • Can I force it to always use dark?
    If you're not using a custom style, choose Dark as the style in Project.txt or on the command line.  If you have a custom style based on Style.txt, edit it to inherit from Dark instead of Default.  This all works for Black as well.  You can't do it with a style that's just a CSS file because those always inherit from Default.

Still to do:

  • Implement saving your choice.  Right now it doesn't so it resets between browser sessions or when you open a new tab.

  • Auto-light/dark and light/black themes.  If you have your browser follow the operating system's theme, there's ways for the documentation to detect that and follow it as well.

SystemVerilog Improvements

SystemVerilog now has an entry in Languages.txt, but this is just a placeholder so you'll probably still need to fill it out a bit more with your own settings to use it.  However, a couple of things have been implemented:

  • Syntax Highlighting. All the SystemVerilog keywords will highlight correctly as well as numeric literals, including complicated ones like 8'b0011_00zz.

  • Module and Package Hierarchies.  In addition to the class and database hierarchies, there are now ones for modules and packages that you can use in Comments.txt.  The final set of hierarchies is still in flux but these two exist for now.

Otherwise it's still the same as basic language support.  It won't find undocumented code structures yet or do any special formatting for prototypes.  More to come.

Fully-Qualified Title Fix

Probably because I primarily work in C#, which has full language support, and JavaScript, where I only use pseudo-classes, I didn't realize this wasn't working.  Suppose you have this:

namespace MyNamespace {

// Class: MyNamespace::MyClass
class MyClass {
...
}
}

You wouldn't get a prototype for MyClass because the declaration doesn't match the full title of MyNamespace::MyClass.  This has been fixed, so it only requires the last segment to exist in the prototype now.

Other Bug Fixes
  • Fixed a potential infinite loop in the XML comment parser.

  • Fixed some minor issues with the C# parser.

Earlier Discuss Share 
Natural Docs 2.2 released
FacebookTwitterE-MailCopy Link