Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did a bit of an overhaul #3

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open

Did a bit of an overhaul #3

wants to merge 85 commits into from

Conversation

prurigro
Copy link
Collaborator

Ahoy there!

I was playing around with arch-wiki-markdown a couple of weeks ago and really liked what you'd come up with, but the docs were a bit out of date and I needed a more recent list of PKGBUILD build variables, so I decided to figure out how to update to a more current iteration of the Arch Wiki. It wasn't long before I'd realized that the changes Archlinux had made to Haskell (or so I assume) had removed a lot of the dependencies, and I ended up having to install them using Cabal. Once I'd finished this, I ran the PKGBUILD and waited, but it soon failed with a bunch of errors that I couldn't seem to trace back to anything in particular (though keep in mind I'm not very experienced with Haskell). I ended up deciding that it would be better to see if I could find a different method to convert the wiki docs, and experimented with a few different directions before finding Pandoc. Now Pandoc is Haskell based as well, but it includes a package in the AUR that produces a static build, so the dependency issue isn't such a big deal, and Pandoc actually managed to convert the collection too (though I had to apply a few more filters to make things nice for our purposes here).

At this point, I'd gotten a general impression of how things worked, and being that I happen to be much more familiar with Bash and Vim (what the rest of the project is in), I figured I'd try my hand at adding some polish, and ended up adding a bunch of small improvements to your original foundation, such as colour to the AWESOME_STYLE, and a more robust configuration for vim along with a modified markdown syntax configuration that includes the conceal feature, which can hide things like the ** ** surrounding bold items, or replace the * of a bullet with a nice unicode bullet character (to keep things organized, I actually forked the vim-markdown project here).

Anyway, I realize a LOT has changed, and I would understand if you'd prefer I simply keep this as a fork, but I do feel like the core project (the arch-wiki script) is mostly untouched, and would be happy to hand the reigns back to you if you like the direction I took things.

Cheers!

prurigro added 30 commits July 13, 2014 18:49
@prurigro
Copy link
Collaborator Author

I should probably mention that I did strip a bunch of stuff out that might have been useful to keep around (like the wiki files, or your upload script), but I only did this to help organize myself, and if you do decide to accept the pull request you should definitely look through and see what you want to add back in :)

@tsgates
Copy link
Owner

tsgates commented Jul 29, 2014

Thanks! Since people (including me) hates using haskell for (only) build, I happen to exclude them from PKGBUILD, but provides the stripped version, which make our package a bit lagging from arch-wiki-docs. I love your most of contributions! But could you check "arch-wiki acpi" for example, the bottom of the page is not rendered quite correctly by vim markdown :) Could you check it again for me?

@prurigro
Copy link
Collaborator Author

I've actually been testing a bunch of docs since sending the pull request and have noticed that here and there as well (the longer the doc the more likely it is to happen). I believe it's the markdown plugin I forked getting confused when it hits the multi-line code, and since I've forked that repo I might not actually have to change anything in this project to make things work. Either way, let me take a look and see if I can come up with a fix.

@prurigro
Copy link
Collaborator Author

Also, re: haskell; I'm not sure if you were talking exclusively about the current arch-wiki-markdown or both it and my changes, but in case you were referring to both, haskell can be removed after pandoc-static has been built, and both I fully agree with your feelings on having it around + have been converting via PKGBUILD, so this project might be able to drop the maintained wiki rip and rely exclusively on the arch-wiki-docs or live (I've been using the live method, which takes about half an hour to build, and it's only a few weeks newer, but a LOT has changed in that few weeks)

@prurigro
Copy link
Collaborator Author

I'm just going through the mkd syntax file now and haven't found the bug responsible for the issue you and I discovered today, but I've already found and fixed a few other upstream bugs which I'll be pushing to plasticboy's repo soon- hopefully I'll have something that doesn't break for our purposes by the end of the night (well, night for me haha).

BTW, off topic, but I just noticed you're the author of mbox, which is an awesome little tool! I found and added it to the Arch Assault repo (here) the other day and have been playing around with it quite a bit since :)

@prurigro
Copy link
Collaborator Author

Cool! I fixed the issue and a few others in my vim-markdown-concealed repo as well as submitting a pull request for them upstream, and I added conceal support for the tags relating to those issues to my repo as well :)

You can test the changes by rebuilding the package, and you can save some time if you still have the package directory with your converted files from your previous build by making with: _wiki_norebuild=1 makepkg

Let me know if you notice any other glaring issues!

@tsgates
Copy link
Owner

tsgates commented Jul 30, 2014

Thanks for quick fix. I actually like most of your updates! Here are three minor stuffs. What do you think?

  1. .. block to indent
  2. 78 width text on non-code (text) blocks, which makes grep fly
  3. minimal color theme by default

@prurigro
Copy link
Collaborator Author

Hey! Thanks for adding me to the project- we could start working out of a branch on this if you want to be doing things in the same place?

  1. Not sure what you mean by this one? Is there a word that indents, or are you suggesting to see if pandoc has a setting to use indentation instead of ``` for code blocks?
  2. I like that plan- I'll see if I can get that one implemented tonight
  3. I threw together the current colorscheme with the hope of coming up with combinations of colours and text style for each element that would be getting hidden by conceal, but the colours themselves could likely be way better. Do you have any ideas on what direction to take? What are you thinking when you suggest "minimal"?

Cheers

@tsgates
Copy link
Owner

tsgates commented Jul 31, 2014

Welcome and thank you for the contributions!

  1. put four spaces (an indent) for each line in ``` and ''' (code blocks)
    • similar to sed commands in PKGBUILD (I think it's good to have a single python script to handle?)
  2. I see. Other than current background colour, looks good to me.

I will be able to find some time to fix them at the end of next week or so (if you can't find time to play with!). Thank you again!

@prurigro
Copy link
Collaborator Author

I set the background so the same colours would work on terminals with both light and dark backgrounds, but a different coloured background could definitely look better. Thoughts on what direction to go? (Lighter? Darker? Some colour?)

Maybe this wouldn't make sense to do until we hammered down a next release (if you like it), but your comment on the colour-scheme gave me an idea. We could have arch-wiki source two files when it calls vim, the first defining a variable for each colour and the second being the arch-wiki-markdown vimrc, which would load the colour-scheme using the defined variables. At that point, it would be possible to have a config file in a user's home directory where they can set any number of available "themes" (as well as maybe setting defaults for things like Normal vs AWESOME_STYLE?), and the wiki theme colours could also be the colours used with AWESOME_STYLE enabled. Thoughts?

@prurigro
Copy link
Collaborator Author

Alright! I've made a ton of changes to this fork of arch-wiki-markdown and even more to vim-markdown-concealed, which works wayyy better now that I fully understand how to implement concealing (most if not all issues it previously had are gone now, and it conceals way more stuff too!). The changes to arch-wiki-markdown include a ton of additional parsing to remove stuff that shouldn't be included and format things better for our purposes, better theme support (I didn't change the colours, but I did a bunch of fine tuning and targetted more syntax groups), tweaked vimrc settings, indented codeblocks instead of the ```-style, and added support for building the wiki with a text width of 78 characters, which almost works perfectly, but due to a few small issues with long links (and especially long links in codeblocks), I set it as an optional variable that defaults to off for now.

When you get a chance, try building with: _wiki_norebuild=1 _wiki_foldlines=1 makepkg -i to enable the text-width of 78 and let me know what you think.

I'm still interested to hear what colour you think the background should be changed to too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants