Comments (10)
As I understand your question, it seems like you are talking about two different thing.
If you want PDF and files other than markdown files to appear in the sidebar and search, then no - this is out of scope for madness. It is not a generic file server, but a structured (yet freeform) documentation server.
As for creating links to other files, of course it is possible, in one of two forms at least:
- Create a link to any other file by using a standard markdown link:
[link to any file](any-file.txt)
- Embed images using a standard markdown image:
![Image Title for embedded image](image.jpg)
- In both cases, the asset can be anywhere, but the link should either be absolute or relative to the folder where the markdown file resides.
Another approach that might be suitable for your use case, is to use HTML iframe to embed any content (text file, PDF document) right inside your markdown. Something like this:
<iframe src="any-file.txt" width="100%" frameborder="0" height="300"/></iframe>
Hope this helps.
from madness.
Thanks for the quick response. What I was asking for is what's out of scope. I already have the .md files with links to images or pdfs to continue to work that way. Thanks for the HTML iframe approach also. Much appreciated...
from madness.
By the way - I am not sure it will be THAT difficult to implement it, in a configurable way.
Perhaps something like a configuration to say:
also_show_extensions: pdf png txt
Does your requirement have anything other than what described earlier?
Should these just appear in the sidebar?
from madness.
That would be great. And that would be my only requirement. It would give me the ability to have a single interface (madness) for all my notes without having to create the underlying .md file with the pdf link as you previously described.
from madness.
Well, I have tried it and it is a little weird.
Adding the links to the menu, is easy enough and easily configurable.
The problem is, that when you click any of these links, it just lets the browser handle these files, so by clicking them, you lose the side menu and everything.
In a more thoughtful implementation, I would have expected to:
- Have the file be rendered inside the template (for supported file extensions), perhaps like GitHub is allowing file preview.
- Have the extension not show in the side menu, and instead show a small "label" with the uppercase extension, or something more elegant than what can be seen in the screencast below.
Anyways - here is a demo screencast, showing pdf and txt link examples.
In your view, is this acceptable as is, or must we render the files inside the usual template?
from madness.
That's 100% what I was expecting. It's totally acceptable. Would be great.
from madness.
Alrighty then. I will organize the code a little, add docs and specs and prepare a version, hopefully you will have time to test it before I release. Will report back here when ready.
from madness.
Hi,
A version is ready if you wish to test it before I pack a new gem release.
To do so, you will need to:
- Add this Gemfile in your madness documentation folder:
# Gemfile
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "madness", github: 'DannyBen/madness', branch: 'add/expose-extensions'
-
run
bundle
-
Add this to your
.madness.yml
config file
expose_extensions: pdf,txt
- run madness with
bundle exec madness
from madness.
Yup, works like a charm and exactly what I was looking for. This is great. I appreciate this a lot.
from madness.
Version 0.9.3 is released to Rubygems, and if you are using the docker version, it is being built right now.
Thanks for your suggestion and feel free to comment here (or open a new issue) if you encounter any problems.
from madness.
Related Issues (20)
- Howto set an "alias" in Windows Powershell? HOT 3
- Mobile Search HOT 6
- Support for Obsidian-style [[links]] and information about backlinks HOT 5
- .madness.yml not being read? HOT 2
- Support for subpath with reverse proxy HOT 29
- Settings cannot take effect HOT 3
- Allow to automatically add a link from every page to the corresponding source file HOT 16
- Create JSON schema for config HOT 6
- Add JSON schema test
- Allow to optionally decouple file and directory names from display names HOT 7
- HTML ids are generated without diacritics and links do not work HOT 9
- An option to highlight a "Note" and "Warning" using blockquote HOT 3
- Docker version 1.1.3 fails to start missing gem HOT 7
- Escape characters in a table HOT 4
- Help ordering file and folder HOT 5
- Markdown files with a name overlapping that of a folder don't open via links HOT 25
- Madness and Github pages HOT 3
- TOC generation (1.1.4) looks inside code blocks HOT 4
- Breadcrumbs are problematic HOT 7
- ToC levels for not autogenerated ToC are not honored HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from madness.