Re: [oll-user] 'snippets' Github interface idea
Resources for LilyPond and LaTeX users writing (about) music
Status: Alpha
Brought to you by:
u-li-1973
From: Urs L. <ul...@op...> - 2013-09-13 08:44:15
|
Am 13.09.2013 01:20, schrieb Janek Warchoł: > Hi all, > > 2013/9/10 Urs Liska <ul...@op... <mailto:ul...@op...>> > > I had an idea to improve the web presentation of the snippets on > Github: > > Write a script that iterates over all snippets and generate a Markdown > file to display the snippet in the Github interface. > I see two options: > - generate an accompanying .md file that can be clicked upon > - place all snippets in its dedicated subdirectory and create a > README.md file > > I would suggest the second solution although that will result in a > large > number of subdirectories. > This way as soon as one opens the directory the README is displayed > automatically. > > > The more i think about this, the more i like it. Having one additional > layer of directories seems to be a small price to pay for > user-friendly interface. In fact, with such an interface our > repository would be almost as functional as LSR currently is. > > In the basic version the generated file would contain > - A heading and a general short introductory text > - A generated image (the example output of the compilable file) > -> one more incentive to include good examples > - The complete code listing > (unfortunately it isn't possible to provide code highlighting > like in > the blog posts) > > > This could simply be a link to the snippet file, if we wanted to make > things simple. I would prefer including the listing. This shouldn't be really complicated, and it would make the code readable in the context of the description. Opening .ly files in a browser usually isn't really exciting ... > > Actually, we may be able to provide syntax highligting: as far as i > know, you can insert HTML into markdown, so we could use your > html-export from Frescobaldi to produce html code and paste it into > the .md file! > ...for some reason this doesn't work as expected. I've added a > markdown file containing html code generated using your Frescobaldi > export, and it isn't coloredd. I think that Github isn't respecting > some aspect of html formatting, maybe that's a bug. > See my attempt here: > https://github.com/openlilylib/snippets/blob/markdown-test/notation-snippets/scaling-stencils.md As you noticed, I had tried the same before ;-) Having written to Github is a good idea. Although I don't think it's a bug but rather an omission. Maybe even on purpose, e.g. for security reasons. > > In a later version one could (quite easily) extract meta information > from the snippet and provide them in a formatted and structured > display. > > > In fact, we might want to switch to markdown in snippet descriptions > because of this. > > The script would be run locally every now and then by an admin. > > > Easy to do with a cron job. I would prefer doing it as a Git hook. It should be possible to check which files have been affected by a commit and act upon this information. > > Some issues to be considered: > - Try to determine snippets to be processed (i. e. only new or > modified > ones) > recompiling snippets with differing LIlyPond versions would > result in > the images to be modified > (i.e. detected as changes by Git) > > > This should be easy: just store the committish of the revision of the > snippet that was used for producing .md and .png files, and check if > think that having a .png file in the snippet directory. If there were > changes in the snippet file since that commit, recompile. You're more experienced with Git than I am. But I think if we hook into the commit itself it would be easier and more reliable to retrieve information on the affected files themselves. > > - Determine appropriate LilyPond versions to compile the snippets > > I would write such a script in Python. > > What do you think? > > > go for it! One day ... Best Urs > > best, > Janek -------------- next part -------------- An HTML attachment was scrubbed... |