arnaudsm / raito Goto Github PK
View Code? Open in Web Editor NEWMini Markdown Wiki/CMS in 8kb of JavaScript
Home Page: https://raito.arnaud.at
License: MIT License
Mini Markdown Wiki/CMS in 8kb of JavaScript
Home Page: https://raito.arnaud.at
License: MIT License
i just use thist at the end of README.md:
## test
include(docs/subdir/subsubdir/)
if a file docs/subdir/subsubdir/README.md
is missing the render process just crash, and get a blank page..
from #9 now that mdwiki are defunct i will test this.. the relative link support from @arnaudsm allow to be the file readable from any git implementation..
You are using ROOT for rendering all the things and that's the problem.. and @uli-heller fixed that! your "relative" inplementation is *from root and not from the current place!
case1: using "[Level 2](subdir-01/subdir-02/)
" this is the current supported @arnaudsm BUT you miscunderstand, it suppost ONLY IF I AM IN UPPER LEVEL ABOVE OF subdir-01
in current place but due you are using a ROOT global path it's working
case2: using "[Level 2](subfolder-02/)
" this is the correct way if were inside https://github.com/arnaudsm/raito/blob/absolute-link-example/subfolder-01/README.md as you can check github renders incorrectly the link and just show: "https://github.com/arnaudsm/raito/blob/absolute-link-example/subfolder-01/subfolder-01/subfolder-02" noted the duplication of "../subfolder-01/subfolder-01/subfol..." at the github..
so that why @uli-heller has right here! -> https://stackoverflow.com/questions/24028561/relative-path-in-html
so i suggest that the changes of the @uli-heller must be implemented, please reopen this issue .. your subdir implementantion are wrong
The current anchor reference implementation at #42 forced to have a hardcoded CSS trick see the video how on any reference the title is "cuttring off" by the scroll
i was thinking in made a workaroun around scrollIntoView using scrollTo that permits to specify an offset, using a config variable if user wants.. with a default value set, i can made a pull request for if you wants..
index 4deecda..d607c3d 100644
--- a/index.html
+++ b/index.html
@@ -11,8 +11,9 @@
<!-- USER CONFIG -->
<script>
const config = {
sitePath: "/",
browserRouter: false,
+ scrollworkaround: true,
name: "Raito",
components: ["docs/navbar", "docs/github"],
errorMessage: "Page not found",
@@ -415,9 +412,17 @@
loadContent();
};
});
- if (selector) document.getElementById(selector).scrollIntoView()
-
+ if (selector) {
+ offsettag = window.innerHeight / 8
+ taganchor = document.getElementById(selector);
+ taganchor.scrollIntoView({behavior: "smooth", block: "start", inline: "start", offset: offsettag})
+ if(config.scrollworkaround) {
+ const y = taganchor.offsetTop - (offsettag);
+ window.scrollTo( { top: y, left: 0, behavior: 'smooth' } );
+ };
+ };
document.body.classList.add("loaded");
+
if (!config.browserRouter) window.location.replace(config.sitePath + path);
};
@arnaudsm, Is it possible to do the equivalent of <a href="/">Home</a>
or <a href="/subdir/a.html">Goto A</a>
in Markdown in Raito?
I've tried many variations but had no luck, and all the examples (/subdir/a, subdir/b, etc) use relative backpathing, e.g. [home](../../..)
in Markdown to get back to the homepage.
Any server root links do not work in markdown, e.g.
[Next](/dir1/)
[Next](/dir1/README.md)
[Home](/)
Thanks for your time!
the SEO its not well explained( #26 ) , or maybe there's a bug, cos it said: disabled by default, since it requires a default redirection to index.html
means that due index.html is the default rendering and the javascrip only parsed the content of the file, the web server need to provide a way to rewrite the url that always request the index.html as end point of each root web page ?
but :
i put to true browserRoute
and sitePAth
to "/wiki"
localhost/wiki/
it renders goodlocalhost/wiki/page
it does not renders if i call from url of browserlocalhost/wiki/page
it renders if i call from a link inside a rendered pageso due last case its called from "index.html" as you pointed, works but you never defined a more explicit method to get such results, i only got a vage idea using rewrite, event spend in CloudFlare and give more importance to a enterprise..
also navbar fails in rare cases:
I forked raito and added subdir support to it (among others). Now I realized that there is a TODO list at the end of the README.md and "subdir support" shows up there.
Are you interested in a pull request?
Currently, my fork is probably way to fat but I'd factor out the subdir support in case you're interested.
Here, there are some examples of some nested subdirs to illustrate my understanding of the feature:
NOTE: this bug are more ancient rather than the last changes you made
alias /home/$1/public_html/$2;
https://www.linode.com/community/questions/6502/nginx-php-in-a-users-public_htmli setup to run raito into the user directory, so:
general
,/home/general/public_html/raito
http://localhost/~general/raito/
sitePath
its set to /~general/raito/
(also tested /~general/raito
)infinite redirections and a url as: http://localhost/~general/raito/#//~general/raito/#//~general/raito/#//~general/raito/#//~general/raito/#//~general/raito/#//~general/raito/#/
but if we change the browserRouter
to true it work! of course cos only index.html its valid rendering
in wikimedia, and dokuwiki there's a way to renders a page inside another.. just something like "frame" tag does in html..
please provide a way to do an include like that, example
page1.md:
# title
lorem ipsum
include(page2.md)
page2.md
more lorem ipsum
expected result
TITLE
lorem ipsum
more lorem ipsum
Could you please add some license info?
This popped up in my own MD files, but I also noticed it in the docs folder as well.
Lines 128 to 130 in f549621
The web request to the server is wrong though:
GET http://<ip-addr>/logo.svg 404 (Not Found)
This does work though:
Output ⬇️
![logo](docs/logo.svg)
Google and most search engines do not index hash routed pages.
We could use the history API to bypass this problem.
Hi,
I would like to include a chart in the markdown website.
for example from chart.js
# My Chart
<canvas id="myChart"></canvas>
<script>
const labels = [
'January',
'February',
'March',
'April',
'May',
'June',
];
const data = {
labels: labels,
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}]
};
const config = {
type: 'line',
data: data,
options: {}
};
const myChart = new Chart(
document.getElementById('myChart'),
config
);
</script>
I put this in a markdown file and added a link to it, like the examples.md
Not sure if that makes sense to you. But I would really appreciate your help.
Thanks
Great project!
This can be managed also as bug, but not cos this project is a debload version and prety minimalistic one..
so i used the feature request. cos can be not so easy to implement but easy to generate the rendering code (i guess it rely on the markdown rendering engine)
By example i can check this same issue with https://github.com/arnaudsm/raito/issues/32
and https://github.com/arnaudsm/raito/issues/32#
as same .. but
To understand internal link see the below examples.
## mytitle
Will become by markdown rendering as:
<h2><a href="#mytitle">mytitle</a><h2>
or more complex will become something like:
<h2><a id="mytitle">mytitle</a></h2>
currently raito does not support such thing by default:
Like your project. But i hate white themes. but someone like it. so best option is
Tried in easybashgui change to theme version 5
Not sure what everything needs to be changed.
I think comment out more color definition. so will be used colors from themes?
Introducing the ULTRALIGHT SIMPLISTIC raito rendering utility, among utilities that use markup.js, as a powered wiki engine, which competes strongly against other engines such as github wiki and mediawiki itself
Including the raito into the utilities that uses marked.js project, it has powered features such as:
Working on Mermaid support to make nice charts in markdown.
i cant understand the code but are the png, svg, jpg etc hashed!? why .. those are just images! and somethings must be cached in both sides
Hi,
I would like to add a table of content to the website.
Do you know how this could be done?
Thanks again!
Ciao
Michael
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.