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

Feature request: urls without ".htm" #44

Closed
AndreyAkinshin opened this issue Mar 28, 2017 · 13 comments
Closed

Feature request: urls without ".htm" #44

AndreyAkinshin opened this issue Mar 28, 2017 · 13 comments

Comments

@AndreyAkinshin
Copy link

If I create a "MySection.md" file using docnet, it will be transformed to MySection.htm with url like http://mydomain.com/MySection.htm which looks ugly and old school. I want to form url in the http://mydomain.com/MySection/ format. It should be easy to implement: we just have to generate MySection folder with index.htm file instead of MySection.md file.
Such feature could have an additional parameter in docnet.json wich allows enabling of disabling it.

@FransBouma
Copy link
Owner

Folder based references don't work offline on disk, which can be a big problem, but if the doc site is only on-line that can work, I guess. I'm a bit puzzled about the 'it's ugly / oldskool' argument, to be honest. ;) I get that references to html pages directly seem to look 'ugly' with the world of MVC, but is it really that big of a problem? Instead of referring to a folder it's referring to a page, 4 chars difference.

With '#' directives to sub sections into the page the 'index.htm' has to be used anyway or does http://mydomain.com/MySection/#subsection work? (I honestly don't know)

@AndreyAkinshin
Copy link
Author

A lot of modern sites support such url style. For example, the url of this page is https://github.com/FransBouma/DocNet/issues/44 instead of https://github.com/FransBouma/DocNet/issues/44.htm =).

It would be really nice to have this optional feature for online only sites.

With '#' directives to sub sections into the page the 'index.htm' has to be used anyway or does http://mydomain.com/MySection/#subsection work?

Yes, it works fine. An example: http://aakinshin.net/en/blog/dotnet/stopwatch/#operation-systems (by the way, my blog also uses the same approach: I have the stopwatch folder with the index.html file inside instead of the stopwatch.html file).

@FransBouma
Copy link
Owner

Yes, the folder structure is useful for MVC routing, though when I try: http://aakinshin.net/en/blog/dotnet/stopwatch/index.html#operation-systems it fails, likely due to failed mvc routing as well. Anyway, it's easy to test of course whether it works or not on a non-MVC static site without routing logic. :)

@AndreyAkinshin
Copy link
Author

@FransBouma
Copy link
Owner

Weird, it works indeed with your url. I must have made a typo somewhere when I tried! Ok, so that's not a problem then! :)

@AndreyAkinshin
Copy link
Author

Awesome, thanks!

@AndreyAkinshin
Copy link
Author

Hey @FransBouma, any progress with the issue? I want to have this feature in BenchmarkDotNet. =)

@FransBouma
Copy link
Owner

FransBouma commented Apr 23, 2017

No time at the moment, sorry. Perhaps this week but as I won't use this feature in our own docs it won't get a high priority so I have to work on it when I have time outside work.

(edit) It's likely not a lot of work, so I'll see what I can do for you this week.

@FransBouma
Copy link
Owner

Well, this is surprisingly more work than one would think. The main issue is that an element's URL is generated by a property without external data. The parameter however is located in the configuration which isn't global, so it can't reach that, ergo it doesn't know if it should create folders instead of files for a markdown file. Making it know it should do that requires either the config to be global / singleton or I have to pass the parameter to the element objects first (which is rather silly too).

Not happy with either situation tbh, so as this is a cosmetic change and not a feature needed for making the tool work, I leave it as it is now. Perhaps I get a different insight later.

@FransBouma
Copy link
Owner

@AndreyAkinshin It's implemented in v0.16, which we'll release shortly :)

@FransBouma FransBouma reopened this Jul 4, 2017
@AndreyAkinshin
Copy link
Author

@FransBouma, awesome! Waiting for v0.16.

@FransBouma
Copy link
Owner

v0.16 has been released yesterday :) You can find it at the releases tab :) https://github.com/FransBouma/DocNet/releases

@FransBouma
Copy link
Owner

Released

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

No branches or pull requests

2 participants