notepad-plus-plus / userDefinedLanguages

Notepad++ User Defined Languages Collection
577 stars 376 forks source link

The 1st draft #2

Closed donho closed 4 years ago

donho commented 4 years ago

The goal of this repository is to provide a UDL center for users who need the programming languages which are not supported directly by Notepad++. Any UDL author can submit their UDL (with an explicit name - "id-name") in UDLs directory so users can find what they want from UDLs directory very easily. However, it's possible that some UDL authors prefer to keep files in their repository rather than submitting files into official User Defined Languages repository (https://github.com/notepad-plus-plus/userDefinedLanguages/UDLs/). They can still submit the URL of their UDL in question.

This repository could be the reference of UDL Admin (todo) in Notepad++ (in the 2nd step). udl-list.json is for such purpos. In the JSON file, "id-name" is the descriptive & uniq ID which should be controlled by the team. The value of "id-name" should be the same of file name without file extension. "repository" is the URL of UDL that Notepad++ (or user) can download. If the UDL is hosted in this repository, "repository" should be an empty string, then Notepad++ (or user) will find file with its id-name + .xml in https://github.com/notepad-plus-plus/userDefinedLanguages/UDLs/ directory.

So the first thing we should define IMO is the rule of "id-name": it should be descriptive and uniq but not contain only the language name like autocad or markdown (there could be several UDLs for the same programming language).

Feel free to discuss about not only the rule of "id-name", but also the structure of the repo, the structure/content of udl-list.json or anything else regarding UDL repository. It's just a draft and everything can be in the other way - with the concensus of members in the team.

pryrt commented 4 years ago

Mostly, I'm glad that the repo exists, and cannot wait to start directing people here

Sorry that I hadn't responded yet to the #1 discussion; I had been thinking about it over the weekend.

id-name / filename rules

other "rules" discussion / questions

I'm not a fan of too many requirements -- I like giving users options/flexibility -- so I'd vote for making both of those "recommend" rather than "require".

repo structure

I think that having the README and json in the top level, and just one UDLs subfolder for containing all the xml files makes sense. If it has too much higherarchy, then people will get lost in the depth. We want this to be simple for people to submit pull requests to add files.

chcg commented 4 years ago

I think we could take over the json checking from https://github.com/notepad-plus-plus/nppPluginList. What are the requirements for the UDL files regarding file format? UTF-8 with or without BOM? Probably that one could be also checked against some xml schema file.

rddim commented 4 years ago

1st – Thank you @donho that you initialize this repo with my UDLs 2nd – What about the autoCompletion files and the folder structure when they are available for the UDL? Will it be acceptable something like:

\userDefinedLanguages\AutoCAD\autoCompletion\AutoCAD.xml \userDefinedLanguages\AutoCAD\AutoCAD.npp.udl.xml \userDefinedLanguages\Markdown_DaringFireball_ThemeChoco.udl.xml \userDefinedLanguages\Markdown_CommonMark_ThemeVimDarkBlue.udl.xml \userDefinedLanguages\Markdown.STL.UDL.byPryrt.xml

FlatAssembler commented 4 years ago

What are your criteria for which language to add? I've made a UDL for a simple (and mostly useless) programming language I've made: https://github.com/FlatAssembler/ArithmeticExpressionCompiler/blob/master/NppSyntaxHighlightingScript.xml

donho commented 4 years ago

@pryrt

Try to give your UDL filename something more than just the language name, because yours might not be the only UDL for that language; possibilities include what theme the color scheme was chosen to be compatible with, or some variant of the language

I would say it should be mandatory - to avoid people monopolize the language name as I said. OTOH, it should be unique - it's important if we decide to deploy with Notepad++.

I'm not a fan of too many requirements -- I like giving users options/flexibility -- so I'd vote for making both of those "recommend" rather than "require". repo structure

I agree - the idea is provide a collection to the users who needs any UDL, and make easier for the authors to encourage them upload their file.

I think that having the README and json in the top level, and just one UDLs subfolder for containing all the xml files makes sense. If it has too much higherarchy, then people will get lost in the depth. We want this to be simple for people to submit pull requests to add files.

So we are on the same page.

donho commented 4 years ago

@chcg

I think we could take over the json checking from https://github.com/notepad-plus-plus/nppPluginList. What are the requirements for the UDL files regarding file format? UTF-8 with or without BOM? Probably that one could be also checked against some xml schema file.

Good idea. I let you implement this feature.

donho commented 4 years ago

@rddim

What about the autoCompletion files and the folder structure when they are available for the UDL?

You're pointed out another issue - about auto-completion file. That needs a solution as well definitely. But let's keep focusing on UDL here - I don't think it's a good idea to mix with other types of file.

donho commented 4 years ago

@FlatAssembler

What are your criteria for which language to add?

You have pointed out a good question. I think it's rather for the languages used by a community. So author should provide a link of the language in question, and a sample of this language to prove his/her UDL is working in the PR. I would even say that we should add a UDL samples folder for such purpose. The files in this folder should have the id-name of UDL, plus its own extension.

FlatAssembler commented 4 years ago

@FlatAssembler

What are your criteria for which language to add?

You have pointed out a good question. I think it's rather for the languages used by a community. So author should provide a link of the language in question, and a sample of this language to prove his/her UDL is working in the PR. I would even say that we should add a UDL samples folder for such purpose. The files in this folder should have the id-name of UDL, plus its own extension.

Well, I think my UDL works well, here is a rather long piece on that language exported from Notepad++ into RTF: https://github.com/FlatAssembler/ArithmeticExpressionCompiler/blob/master/HybridSort/hsort.aec.rtf The line numbers were added in RichEd. Here is the original source code: https://github.com/FlatAssembler/ArithmeticExpressionCompiler/blob/master/HybridSort/hsort.aec And the code blocks generally work, except for the macros. But the macros don't really belong to that language, they are in inlined assembly.

pryrt commented 4 years ago

Since the conversation had died down, I made a PR for a second draft, with our Submission guidelines codified in the README.md. Feel free to continue discussing here, or in the PR.

pryrt commented 4 years ago

Speaking of more discussion here: one thing I found slightly unclear from the conversation: 1) were we expecting each author to update the json file themselves? or 2) would we always do that ourselves based on their PR (to prevent errors)? or 3) would we allow either, and just check any JSON edits they submitted before merging into the repo?

My vote would be 3.

donho commented 4 years ago

For me it's always from the author's PR then we should do minimum of control for checking the validity of UDL (also control the functionality by using the examples they provide, if it's possible). Don't forget control the entry they add in udl-list.json. So I vote for 3 as well.

pryrt commented 4 years ago

Okay, I've updated the wording to allow for #3.

Thanks for your feedback.

pryrt commented 4 years ago

Please see PR #6 and comment on practical issues regarding our naming rules and linking to UDL in external repos. Thanks