Community
    • Login

    [ALPHA] Upcoming Plugin: HiddenLexers

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    11 Posts 2 Posters 203 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic was forked from Using Notepad++ to Organize Game Guides and Documentation PeterJones
    This topic has been deleted. Only users with topic management privileges can see it.
    • mpheathM Offline
      mpheath @PeterJones
      last edited by

      @PeterJones I have tried the HiddenLexer plugin and I am impressed. I tried to add another lexer though failing to style for some unknown reason. When the plugin progresses from the Alpha state then may try again. The “Hello Notepad++” works too though Notepad++ does not seem to respond back with a “Hello Plugin” :). The plugin has some good potential to access the other 1/3 of lexers that Lexilla provides. The plugin is looking good so far with the setup of AsciiDoc. I checked the history and the AsciiDoc lexer was added and released in December of 2021. This is probably the first time that I have seen AsciiDoc working as I have no previous experience with using the format.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @mpheath
        last edited by

        @mpheath said:

        I tried to add another lexer though failing to style for some unknown reason. When the plugin progresses from the Alpha state then may try again

        Open an issue in my repo, with the config json and a test file showing it not working…

        mpheathM 1 Reply Last reply Reply Quote 0
        • mpheathM Offline
          mpheath @PeterJones
          last edited by

          @PeterJones The mysql lexer has no real use with default style so was not seeing results though as developing the json some more then it started showing good progress. Perseverance wins in the end. Just need to get familiar with what’s required and I remembered that I am awful with styling colours.

          1 Reply Last reply Reply Quote 1
          • PeterJonesP Online
            PeterJones
            last edited by

            NOTE: I split this out from the Using Notepad++ to Organize Game Guides and Documentation because it distracts from the original conversation, and is really about something separate from that discussion.

            1 Reply Last reply Reply Quote 0
            • PeterJonesP Online
              PeterJones
              last edited by PeterJones

              Updated artifacts: https://github.com/pryrt/NppPlugin-HiddenLexers/actions/runs/31041591210 (again, limited time availability, only for alpha testing)

              • Got rid of the “Hello” actions. ;-)
              • Added About box
              • Added Edit Config File to open the correct JSON file
              • Added Reread Config to reload the settings from the JSON
                • when you are editing the JSON in Notepad++, when you save that file, it should automatically reread the config. (you will have to activate the tab with the example file to see the update in highlighting)

              This build should make it much easier for incremental changes to the JSON, without having to reload Notepad++ every time. :-)


              Also, now I’ve updated the README at https://github.com/pryrt/NppPlugin-HiddenLexers


              Call For Testers

              It seems to be basically working at this point. If @mpheath and others could give it a test, that would be appreciated. I don’t personally need this plugin, as I don’t have any hidden lexers I want to activate, so I don’t know if I’ve missed anything critical or obvious. But from my tests with STATA (one of the languages that the original HiddenLexers.py handled) and ASCIIDoc (per the start of this conversation), I think it’s working reasonably.

              I know that Lexilla has various config-variables for some of the lexers. If not having config variables available is a deal breaker for you, let me know which lexer you need it for, and give an example file and JSON to show me why that option is critical, and I can prioritize getting it added before I do the v1.0 release. Otherwise, the lexilla-options will probably not be included until a future version.

              1 Reply Last reply Reply Quote 0
              • PeterJonesP Online
                PeterJones
                last edited by

                I was able to find an example lexer that had an option that I could see the effect of, so was able to confirm that I seemed to be processing correctly.

                v0.0.1.1-dev

                • add options processing

                example JSON:

                {
                  "extensions": {
                    "md": "markdown",
                    "markdown": "markdown"
                  },
                  "lexers": {
                    "markdown": {
                        "0  SCE_MARKDOWN_DEFAULT"    : { "fgColor": "", "bgColor": "", "fontStyle": "0" },
                        "1  SCE_MARKDOWN_LINE_BEGIN" : { "fgColor": "DADADA", "bgColor": "", "fontStyle": "0" },
                        "2  SCE_MARKDOWN_STRONG1"    : { "fgColor": "EECCAA", "bgColor": "", "fontStyle": "1" },
                        "3  SCE_MARKDOWN_STRONG2"    : { "fgColor": "EECCAA", "bgColor": "4F4F4F", "fontStyle": "1" },
                        "4  SCE_MARKDOWN_EM1"        : { "fgColor": "AADDFF", "bgColor": "", "fontStyle": "2" },
                        "5  SCE_MARKDOWN_EM2"        : { "fgColor": "AADDFF", "bgColor": "4F4F4F", "fontStyle": "2" },
                        "6  SCE_MARKDOWN_HEADER1"    : { "fgColor": "FFFFFF", "bgColor": "8F8F8F", "fontStyle": "1" },
                        "7  SCE_MARKDOWN_HEADER2"    : { "fgColor": "CCffff", "bgColor": "7F7F7F", "fontStyle": "1" },
                        "8  SCE_MARKDOWN_HEADER3"    : { "fgColor": "CCbbbb", "bgColor": "6F6F6F", "fontStyle": "1" },
                        "9  SCE_MARKDOWN_HEADER4"    : { "fgColor": "CC7777", "bgColor": "5F5F5F", "fontStyle": "1" },
                        "10 SCE_MARKDOWN_HEADER5"    : { "fgColor": "CC3333", "bgColor": "4F4F4F", "fontStyle": "1" },
                        "11 SCE_MARKDOWN_HEADER6"    : { "fgColor": "CC0000", "bgColor": "3F3F3F", "fontStyle": "1" },
                        "12 SCE_MARKDOWN_PRECHAR"    : { "fgColor": "5F5F5F", "bgColor": "4F4F4F", "fontStyle": "0" },
                        "13 SCE_MARKDOWN_ULIST_ITEM" : { "fgColor": "0000CC", "bgColor": "4F4F4F", "fontStyle": "0" },
                        "14 SCE_MARKDOWN_OLIST_ITEM" : { "fgColor": "0000CC", "bgColor": "4F4F4F", "fontStyle": "0" },
                        "15 SCE_MARKDOWN_BLOCKQUOTE" : { "fgColor": "00CC00", "bgColor": "4F4F4F", "fontStyle": "0" },
                        "16 SCE_MARKDOWN_STRIKEOUT"  : { "fgColor": "6F6F6F", "bgColor": "", "fontStyle": "0" },
                        "17 SCE_MARKDOWN_HRULE"      : { "fgColor": "FFFFFF", "bgColor": "0020C0", "fontStyle": "0" },
                        "18 SCE_MARKDOWN_LINK"       : { "fgColor": "8F8FFF", "bgColor": "", "fontStyle": "4" },
                        "19 SCE_MARKDOWN_CODE"       : { "fgColor": "FFFF00", "bgColor": "6F6F6F", "fontStyle": "0" },
                        "20 SCE_MARKDOWN_CODE2"      : { "fgColor": "FFFF00", "bgColor": "6F6F6F", "fontStyle": "0" },
                        "21 SCE_MARKDOWN_CODEBK"     : { "fgColor": "FFFF00", "bgColor": "6F6F6F", "fontStyle": "0" },
                        "options": { "lexer.markdown.header.eolfill": "1" },
                        "keywords": [ "", "", "", "", "", "", "", "", "" ]
                    }
                  }
                }
                

                I verified the functionality using AllStyles.md from the lexilla test suite in N++ codebase; I can change from "1" to "0" and watch the header lines change:

                • “1”: 7a8b4e58-b893-4fb8-bb9a-6e5ca3f67618-image.jpeg
                • “0”: 3c97a3c7-7586-4d10-9666-625450717e3d-image.jpeg

                So I believe that options are implemented now.

                Also, this one is in a release tag, so you can either find the artifacts as before, or you can download a normal PluginsAdmin-style zipfile which can be unzipped and the DLL installed, as with any normal manual plugin installation.

                mpheathM 1 Reply Last reply Reply Quote 1
                • mpheathM Offline
                  mpheath @PeterJones
                  last edited by mpheath

                  @PeterJones You have enabled the lexer property of lexer.markdown.header.eolfill though the styles are not using it as I see in the images. For clarity, I am focussing on eolfilled on the style id rather then the property itself so could an extra attribute not available currently.

                  Here is a example in SciTE on the level 1 header:

                  eolfilled.png

                  As the styling shows:

                  {6}# Tools
                  {1}
                  {0}Lua scripts that can be executed by dofile.{1}
                  
                  
                  {7}## Ideas
                  {1}
                  

                  there is nothing preventing style id 6 to fill the whole line with the background colour if the eolfilled style is used.

                  I added this to SciTE’s Option -> Open User Options File

                  # SCE_MARKDOWN_HEADER1: "#" - Level-one header
                  style.markdown.6=fore:#FF7766,bold,back:#700000,eolfilled
                  

                  The json file could have eolFilled attribute setting like the fontStyle attribute so is applied for the style id.

                  PeterJonesP 1 Reply Last reply Reply Quote 0
                  • PeterJonesP Online
                    PeterJones @mpheath
                    last edited by

                    @mpheath said:

                    @PeterJones You have enabled the lexer property of lexer.markdown.header.eolfill though the styles are not using it as I see in the images.

                    Well, it partially used it, in that the style went to the end of the header text instead of just the end of the ### symbols.

                    The json file could have eolFilled attribute setting like the fontStyle attribute so is applied for the style id.

                    I didn’t know/remember that SCI_STYLESETEOLFILLED existed until your post made me go look for it. I will have to add that attribute to the style info in the JSON

                    mpheathM 1 Reply Last reply Reply Quote 1
                    • mpheathM Offline
                      mpheath @PeterJones
                      last edited by mpheath

                      @PeterJones I just did an edit before you replied. The property does change the processing of headers the eolfilled though on the style itself is absent.

                      PeterJonesP 1 Reply Last reply Reply Quote 0
                      • PeterJonesP Online
                        PeterJones @mpheath
                        last edited by

                        v0.0.1.2-dev

                        • Add the "eolFilled": "1" attribute to the JSON (expected values: not supplied, "","0","1"). This will allow lexers that support the SCI_STYLESETEOLFILLED style to fill the styling to the end of the window instead of the end of the text.

                        e40ab72a-6d2e-40b0-978d-e0fe127a46b2-image.jpeg

                                "6  SCE_MARKDOWN_HEADER1"    : { "fgColor": "FFFFFF", "bgColor": "8F8F8F", "fontStyle": "1", "eolFilled": "1" },
                                "7  SCE_MARKDOWN_HEADER2"    : { "fgColor": "CCffff", "bgColor": "7F7F7F", "fontStyle": "1", "eolFilled": "1" },
                                "8  SCE_MARKDOWN_HEADER3"    : { "fgColor": "CCbbbb", "bgColor": "6F6F6F", "fontStyle": "1", "eolFilled": "1" },
                                "9  SCE_MARKDOWN_HEADER4"    : { "fgColor": "CC7777", "bgColor": "5F5F5F", "fontStyle": "1", "eolFilled": "1" },
                                "10 SCE_MARKDOWN_HEADER5"    : { "fgColor": "CC3333", "bgColor": "4F4F4F", "fontStyle": "1", "eolFilled": "1" },
                                "11 SCE_MARKDOWN_HEADER6"    : { "fgColor": "CC0000", "bgColor": "474747", "fontStyle": "1", "eolFilled": "1" },
                        
                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors