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

Already on GitHub? Sign in to your account

Feature request: Make page extension configurable. #298

Closed
jplona opened this Issue May 21, 2012 · 18 comments

Comments

Projects
None yet
8 participants

jplona commented May 21, 2012

I have a repository full of markdown files with extensions such as 'md', 'mkdn', 'markdown', etc. I can easily rename them all to '.page', but then other tools (such as vim) won't recognize them by default.

Allowing the user to configure a map from extension to format, or even just having a sane default mapping would be enough to satisfy this need.

Owner

jgm commented May 22, 2012

It's a good suggestion, and I plan to allow this in the gitit rewrite.

On Mon, May 21, 2012 at 9:03 AM, jplona <
reply@reply.github.com

wrote:

I have a repository full of markdown files with extensions such as 'md',
'mkdn', 'markdown', etc. I can easily rename them all to '.page', but then
other tools (such as vim) won't recognize them by default.

Allowing the user to configure a map from extension to format, or even
just having a sane default mapping would be enough to satisfy this need.


Reply to this email directly or view it on GitHub:
#298

michelk commented Jul 10, 2012

I would also appreciate using .md extension, instead of .page -- which is similar to the github-wiki, gollum.

Owner

jgm commented Jul 10, 2012

Yes, this feature will be in gitit2, which is getting nearer to
completion now.

+++ michelk [Jul 10 12 00:59 ]:

I would also appreciate using .md extension, instead of .page -- which is similar to the github-wiki, gollum.


Reply to this email directly or view it on GitHub:
#298 (comment)

hcoles commented Aug 7, 2014

Could this be added to gitit? We'd also find this useful, but unfortunately gitit2 doesn't look to be close to release.

Contributor

wcaleb commented Aug 8, 2014

@jgm I'll try to work on this. Would be a good learning exercise for me.

hcoles commented Aug 8, 2014

@wcaleb That would be great.

A possibly easy to implement compromise that occured to me was to treat the pattern

foo.page.<anything>

As a page.

So

foo.page
foo.page.md
foo.page.markdown

Would all be treated as pages.

This would avoid having to parse any configuration and would mean that pages would still be easy to identify (I think a concern about performance was mentioned in the google group discussion is different file extension were allowed).

Contributor

wcaleb commented Aug 13, 2014

@jgm I started working on implementing configurable page extension for Gitit.

https://github.com/wcaleb/gitit/tree/cfgPageExtension

I've run into a couple of problems that you may see an easy fix for.

  1. I modified the number of arguments pageForPath takes, which is breaking the runTransformer function in ContentTransformers.hs (which takes a (String -> String) function as an argument.
  2. I haven't figured out how to adjust the extract function in Feed.hs to account for the changes made elsewhere.

Are these signs my whole approach is off, or is there an easy type definition related fix that I can make somewhere?

Realize you're busy with Pandoc at the moment, so no hurry on this.

Contributor

wcaleb commented Aug 15, 2014

I've continued working on this, and fixed the first question, but not the second. I also made extensive changes in Handlers.hs that seems to have broken basic functionality. Tried to follow along with what you did in Gitit2, but I'm clearly missing something somewhere.

Contributor

wcaleb commented Aug 15, 2014

Actually, the problem that was breaking everything was caused by an oversight now fixed. I think I have basic functionality now, but some changes I made in the handlers are preventing non-pages from showing up in the Index list. Getting closer ...

jlisee commented Aug 16, 2014

I am not sure how much this will help you but on my fork I figured out how to make it a build time configurable option. I am a haskell noob so I failed at the runtime configurable option.

Contributor

wcaleb commented Aug 16, 2014

Thanks, I'm a newb myself! Runtime is trickier because getting the extension from the config file means having to deal with IO and monads. I'm pretty close to a pull request.

smari commented Jan 12, 2015

I would also like this feature, as I have the wiki's git archive cloned to my Android and am using JotterPadX there to edit the files -- but JotterPadX won't allow arbitrary file extensions. Therefore I'm stuck with manually moving files created in that before pushing them to git, which is a pretty messy workflow.

Contributor

wcaleb commented Jan 12, 2015

@smari If you are willing to accept the remaining bugs, merging #445 may work for you.

smari commented Jan 13, 2015

Hi! That would work, except I'm installing from Caleb and don't really want to be mucking about in the code. I'd rather just be a bit annoying. :-)

Contributor

wcaleb commented Jan 13, 2015

I assume you mean "installing from Cabal"? ;-)

Sent from my iPhone

On Jan 13, 2015, at 3:59 AM, Smári McCarthy notifications@github.com wrote:

Hi! That would work, except I'm installing from Caleb and don't really want to be mucking about in the code. I'd rather just be a bit annoying. :-)


Reply to this email directly or view it on GitHub.

smari commented Jan 13, 2015

Uh, yes. Sorry, that was a brainfart. Or perhaps I meant Kobol? :-)

baco commented Jun 26, 2015

When are #445 commits (7be7dfc and d98c60c) merging into master?

Owner

jgm commented Jun 26, 2015

I've just merged #445.

@jgm jgm closed this Jun 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment