Markdown for plugin descriptions - #1142
Conversation
|
Here's an example of integrating a generated script into our Makefiles: |
|
Thanks, BTW, this is a pleasant surprise. :) |
There was a problem hiding this comment.
A few other bits that will need doing, some of which I'm sure you're aware of:
- Switch the C++ code to use the new descriptions and remove the old ones.
- Potentially reformat the plugin help so it fits within the 80 char line limit when it's in a string.
- Add the new README.mds (and the script) to the relevant Makefile.mk's
| @@ -1,5 +1,37 @@ | |||
| USBDMX Plugin | |||
There was a problem hiding this comment.
Can you split the dev info out into a readme developer file of some sort please, as we don't need it to appear in the UI for the users.
It probably makes sense to standardise plugins/osc/README in the same way at the same time.
| identifier="PLUGINS_${plugin}_DESCRIPTION_H_"; | ||
| identifier=`echo "$identifier" | tr '[:lower:]' '[:upper:]'` | ||
|
|
||
| echo "#ifndef $identifier" > $outfile; |
There was a problem hiding this comment.
You'll need to add an appropriate header with licenses too. See https://github.com/OpenLightingProject/ola/blob/master/include/ola/make_plugin_id.sh for an example.
|
|
||
| plugin=`basename "$path"` | ||
|
|
||
| desc=`sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\\\\\\\n"\n"/g' "$path/README.md"`; |
There was a problem hiding this comment.
That's an impressive number of backspace escapes!
There was a problem hiding this comment.
Yeah, but it works 😀
|
Given there are a number of plugins here, it probably makes sense to go through the review cycle with just one initially, then when we're happy you can apply the reviewed change style to all the other plugins, rather than repeatedly changing everything each time until it's sorted. |
* call convert_README_to_header.sh from automake tools * use plugin_description in Karate plugin
|
See Karate plugin for how I did it. If that suits your needs, it's easy to add it for the other plugins, too. |
* fix osc Makefile * fix line length * rename ifndef variable
|
Unfortunately, it doesn't work on Travis :( EDIT: The linter task has generated it. Now I'm completely confused. |
| include plugins/uartdmx/Makefile.mk | ||
| endif | ||
|
|
||
| include/ola/plugins/%_plugin_desc.h: plugins/%/README.md plugins/convert_README_to_header.sh plugins/Makefile.mk |
There was a problem hiding this comment.
I'd just stick it in the relevant plugin folder, so presumably plugins/%/%_plugin_desc.h, rather than putting it in include; we've got plenty of other headers in those folders already.
There was a problem hiding this comment.
double %s don't work unfortunately. Should I rather go for plugins/%/PluginDescription.h?
| endif | ||
|
|
||
| EXTRA_DIST += plugins/karate/README.protocol | ||
| EXTRA_DIST += plugins/karate/README.md \ |
There was a problem hiding this comment.
We generally just go for += \ on the first line, then list everything indented beneath as you've done below.
| BUILT_SOURCES += include/ola/plugins/karate_plugin_desc.h | ||
| lib_LTLIBRARIES += plugins/karate/libolakarate.la | ||
| plugins_karate_libolakarate_la_SOURCES = \ | ||
| include/ola/plugins/karate_plugin_desc.h \ |
There was a problem hiding this comment.
Can you fix the indenting please.
add other READMEs to fix Travis failing
|
Travis is still failing, but only on Mac OS / XCode. The compiler complains Expected ';' after top level declarator. It could be this issue: http://stackoverflow.com/questions/12160733/xcode-doesnt-recognize-the-word-class So I'll try making it a .cpp file instead of a .h header. |
|
My suspicion is your sed command isn't working correctly on the Mac, see this line you've got '0.1\n"n"==='; where it should be multiple lines or something: You could try changing travis-ci.sh to cat out the file you're having issues with in the after_failure section. |
According to http://stackoverflow.com/a/16576291, \n is not recognized on Mac OS as a newline character, but \[actual newline] works. Let's try it out :)
This reverts commit 2a51b74.
peternewman
left a comment
There was a problem hiding this comment.
Mostly just minor nits. I personally don't like convert_README_to_header.sh as a filename, particularly the mixed case, but that's entirely irrational and down to me, and I can't think of a legitimate reason to change it!
Have you tested that the output still looks okay via ola_plugin_info and the old web UI?
| | 1 | 15 | 0 | 496 | | ||
| | 1 | 15 | 15 | 511 | | ||
|
|
||
| That is `Port Address = (Net << 8) + (Subnet << 4) + (Universe % 4)` |
There was a problem hiding this comment.
This should be % 16 at the end.
| * Sensor Device, with a number of sensors implemented | ||
| * Network Device, with E1.37-2 PIDs | ||
|
|
||
| The number of each device is configurable. |
There was a problem hiding this comment.
Changing number to quantity would probably make it more readable.
There was a problem hiding this comment.
Or "The number of each type of device is configurable."
| The number of input ports to create up to a max of 32. | ||
|
|
||
| `ip = [a.b.c.d|<interface_name>]` | ||
| The ip address or interface name to bind to. If not specified it will use |
| ## Config file: `ola-espnet.conf` | ||
|
|
||
| `ip = [a.b.c.d|<interface_name>]` | ||
| The ip address or interface name to bind to. If not specified it will use |
| # The OLA artnet plugin | ||
| lib_LTLIBRARIES += plugins/artnet/libolaartnet.la | ||
| plugins_artnet_libolaartnet_la_SOURCES = \ | ||
| plugins/artnet/ArtNetPluginDescription.h \ |
There was a problem hiding this comment.
Can we put this below ArtNetPlugin.h please.
| @@ -1,3 +1,6 @@ | |||
| OSC Plugin Developer Information | |||
There was a problem hiding this comment.
Is the file Markdown, or just something that looks similar? If the former, can we give it a .md extension.
There was a problem hiding this comment.
It was just something similar but I transformed it.
| Set the DSCP value for the packets. Range is 0-63. | ||
|
|
||
| `ip = [a.b.c.d|<interface_name>]` | ||
| The ip address or interface name to bind to. If not specified it will use |
| ## Config file: `ola-sandnet.conf` | ||
|
|
||
| `ip = [a.b.c.d|<interface_name>]` | ||
| The ip address or interface name to bind to. If not specified it will use |
| ## Config file: `ola-shownet.conf` | ||
|
|
||
| `ip = [a.b.c.d|<interface_name>]` | ||
| The ip address or interface name to bind to. If not specified it will use |
| endif | ||
|
|
||
| EXTRA_DIST += plugins/stageprofi/README.md | ||
|
|
There was a problem hiding this comment.
Can we remove the blank line please.
|
@nomis52 can you review the changes. @daveol can you take a look at the JS changes please. I'm tempted to say we merge this as is, when the outstanding nits are fixed. Then get @FloEdelmann to do the other plugins promptly afterwards and merge them in a second PR to keep the diff sizes down. As long as he checks that no-one has updated plugin descriptions in the meantime (which seems unlikely aside from #1147 , then we should be fine). |
| open as you step through the explanations. | ||
|
|
||
| Let's get to it. If you make it all the way through this doc and I ever meet | ||
| you in person I'll buy you a beer! |
There was a problem hiding this comment.
Ok I already made it through the doc 😆
There was a problem hiding this comment.
Heh, you need to talk to @nomis52 for that, and fly to the states! Or I'll buy you one if I see you in the UK.
There was a problem hiding this comment.
Those are both a bit far away for me unfortunately...
There was a problem hiding this comment.
Well if you ever end up over either way...
|
The output for the old web UI / |
|
Excellent. As long as they look readable don't have formatting quirks and the line breaks etc still work, that's fine. |
|
@nomis52 I'm happy with this, do you want to give it a once over too please? |
|
Still no update? As soon as this is merged, I'll update the other plugins to let them also use their README files in the C++ code. |
nomis52
left a comment
There was a problem hiding this comment.
My only comment is that I would have called these CONFIG.md.
Other than that it looks fine.
|
Thanks @nomis52 . I think the benefit of them being README.md is that it partially self-documents on GitHub, as you get the introduction to each plugin in it's plugin folder, like so: I'm going to force merge this, so you can get working on the other plugins @FloEdelmann , as the test failure is related to some Travis changes I made the other day rather than your code. |
I started progress to close #678 and project 1.
The plugin descriptions are converted to Markdown (
README.mdin each directory). I've also written a shell script to convert those Markdown files into C++ header files which can be called automatically during build. I don't know how to integrate that into the automake toolchain, so I leave this open for you ;)You can tell me how to start and I'll try to do it myself.