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

Suport for image files and ignore directories #9

Closed
wants to merge 2 commits into from

Conversation

paulodiovani
Copy link
Contributor

Previous, any image file was simply not being served, as Raneto tries to parse it as markdown.

This Patch adds a simple test before serving a document and, if it's a simple image file, just serve if with sendfile().

- Images can now be embed with `<img>` of markdown
  `![]()`.
- The fallback (no image) is to serve markdown documents;
- Formats supported (by extension): PNG, JPEG, GIF, SVG;
@gilbitron
Copy link
Collaborator

It's a nice solution but I'd rather see people use public/images for serving images and maybe add a %images_url% variable that can be used in Markdown files.

@gilbitron gilbitron closed this Jun 3, 2014
@paulodiovani
Copy link
Contributor Author

But using public/images/ will forbid relative paths between Markdown files and images (or download links).

Figure that someone may want to be able to read his documents on GitHub as well. Or that someone is migrating from another Markdown server application.

I think that allow relative paths between docs and images is an important feature.

@gilbitron
Copy link
Collaborator

Ok fair point. I can't merge this now as I made a major change yesterday but will look at implementing it myself (unless you want to resubmit a pull request using the new code).

@paulodiovani
Copy link
Contributor Author

Ok, I'll try to merge your changes and then, submit a new pull request.

@paulodiovani
Copy link
Contributor Author

What about the ignore dir feature?

Do you plan something else for that or may I submit the patch again?

I would prefer to use a hidden .ignore file, but some users may get confused with hidden files (specialy on Windows).

@gilbitron
Copy link
Collaborator

I like the ignore feature but submit it as a separate pull request. I agree that the file should just be ignore to keep things simple.

Also just so you know this kind of functionality has been moved to https://github.com/gilbitron/Raneto-Core

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.

None yet

2 participants