FransBouma / DocNet

Your friendly static documentation generator, using markdown files to build the content.
http://fransbouma.github.io/DocNet/
248 stars 36 forks source link

Support conversion of local links to md files (disabled by default, c… #52

Closed GeertvanHorrik closed 7 years ago

GeertvanHorrik commented 7 years ago

Disabled by default, can be enabled by ConvertLocalLinks="true" in the config

Fixes #50

GeertvanHorrik commented 7 years ago

1 thing left if it's really a strict requirement in LinkDefinition.cs:

// TODO: Check if link exists in the ToC

FransBouma commented 7 years ago

1 thing left if it's really a strict requirement in LinkDefinition.cs:

what do you mean by this exactly?

Btw, could you add a test which handles (LocalLink to Bla)[./somefile.md#bla]

GeertvanHorrik commented 7 years ago

Will add the tests, should be supported though.

My idea was it only makes sense to convert md links when they are actually being converted to htm (thus included in the ToC). However, we're not aware of that context so deep in the parser / converter.

FransBouma commented 7 years ago

Ah makes sense, yes it's not clear to the parser which links are in scope, in fact that's a hard problem to do while not being finished with all the pages, I think.

Thanks for the tests and code! Will try out the PR and merge if everything is in order.

FransBouma commented 7 years ago

Oh and documentation... I'll add some docs about this feature too.

FransBouma commented 7 years ago

I'll release a new build in releases when your other PR is merged...

FransBouma commented 7 years ago

And now for the weird part... I can't get it to work with the docnet docs... Very strange... Debugging...

FransBouma commented 7 years ago

Scratch that, I'm an idiot. I formulated the URL markdown wrong!

FransBouma commented 7 years ago

FOr reference: http://fransbouma.github.io/DocNet/markdownsupport.htm#linking

GeertvanHorrik commented 7 years ago

Just checked the docs: I haven't tested the true, false values as strings, I just use it without quotes. Will prepare the other pr now.

FransBouma commented 7 years ago

oh I assumed I had to specify everything as strings, as it's json :) (it likely also converts "1" to true, but not sure). Didn't know you could specify true as a value without quotes!