JavaScript documentation is bad, we need a hub

98 views
Skip to first unread message

Kalcifer Kandari

unread,
May 21, 2020, 5:19:14 PM5/21/20
to TiddlyWikiDocs
Hello,

I'm attempting to implement 18 lines of JavaScript code into TiddlyWiki because I don't know if there is another way, here is a thread for that.

The code:
<!-- A button with an image inside. Call the function we define below with this element as the argument. -->
<button onclick="fullscreen(this);"><img src="test.png"></button>

<script>
function fullscreen(element) {

   
// Really we want the immediate child of the element we passed.
    element
= element.children[0];

   
// Request fullscreen.
   
if (element.requestFullscreen) {
        element
.requestFullscreen();
   
} else if (element.mozRequestFullScreen) { /* Firefox */
        element
.mozRequestFullScreen();
   
} else if (element.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
        element
.webkitRequestFullscreen();
   
} else if (element.msRequestFullscreen) { /* IE/Edge */
        element
.msRequestFullscreen();
   
}
}
</script>

As someone who does not code in JavaScript or much in general, I've noticed there is no documentation hub outlining all the ways this is possible.

As far as I have found, the tutorial on plugins consists of this:

For example files see the plugins in the TiddlyWiki5 repository i.e. those located at plugins/tiddlywiki/.

I don't mean to be rude, but this is pathetic.

I have so many questions, and there are no answers, and if there are answers they are so buried they might as well not exist.
  1. How many ways to add JavaScript to TiddlyWiki are there?
  2. Can I use the <script> tag? If not, why not?
  3. There is a application/javascript tiddler type, what's that for?
  4. What can and can't a JavaScript macro do? How do you make one?
  5. What can plugins do? Is there an API? If so, where is the API reference?
  6. What are all the way you can make a plugin? What is the easiest or recommended way?
  7. What is the limit of widgets, at what point do you need move to JavaScript solutions?
This is a request a for proper hub that is easy to find and navigate, with good tutorials and references. It might be worth starting https://tiddlywiki.com/dev from scratch with better direction.

Each section should have a hub, such as below.

Hub:
  • Getting started
  • Tutorials
  • Recommended practices
  • FAQ and gotchas
  • Reference
    • Architecture organisation (if applicable)
    • File organisation (if applicable)
    • API reference
  • Troubleshooting
  • Glossary
For example the main page should be organised something like this:
  • Extending TiddlyWiki: Basic
    • Style
      • Custom CSS
        • Hub
      • Advanced
        • Themes
          • Hub
The blender docs are a good example of documentation for a large open source project. They use https://readthedocs.org/ which doesn't require forking, though I can see how ironic it would be to use something other than TiddlyWiki.

Lots of images, lots of videos, lots of detail. Nothing left undocumented. We don't want no documentation, we don't want bad documentation, we want good documentation.
  • Comprehensive.
  • Consise.
  • Up-to-date.
  • Easy to search.
  • Easy to edit.
  • Good as a reference.
  • Good as a tutorial.
  • Beginner friendly.
  • Advanced friendly.
I'm a beginner to the grit of TiddlyWiki, but with the help of experts, if we agree on and get a structure setup, and create an empty page per title for people to contribute to, this is doable. What are you thoughts?

Kalcifer

Mat

unread,
May 21, 2020, 5:33:41 PM5/21/20
to TiddlyWikiDocs
Hi Kalcifer

As you already know from my other answers, I con't answer your coding question but regarding:
Can I use the <script> tag? If not, why not?
<script> tags are removed at start for security reasons. It would be easy to spread malicious stuff otherwise when things are shared int he community. But you can, indeed, add/run js via plugins, if I understand right.
What can plugins do? Is there an API? If so, where is the API reference?
No API that I've heard of. I'd say plugins can do anything. 
What are all the way you can make a plugin? What is the easiest or recommended way?
The easiest is via a plugin called Tinka.

Your request for hubs etc makes sense. I would really like it. But who would set it up and lead it? In contrast to Blender, there's no money involved in TW not even via ads.

<:-)

Rizwan Ishak

unread,
May 21, 2020, 5:35:28 PM5/21/20
to tiddlyw...@googlegroups.com
Have you considered using a modal?

Search docs for modal

You can use CSS to make modals full screen

--
To post: TiddlyW...@googlegroups.com
To unsubscribe: TiddlyWikiDoc...@googlegroups.com
More info: http://groups.google.com/group/tiddlywikidocs?hl=en
Visit the wiki at: http://wiki.tiddlywiki.org
---
You received this message because you are subscribed to the Google Groups "TiddlyWikiDocs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikidoc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidocs/e94d972f-6034-43b3-9b0b-4b747cf67fa9%40googlegroups.com.

Mat

unread,
May 21, 2020, 5:47:42 PM5/21/20
to TiddlyWikiDocs
Riz wrote:
You can use CSS to make modals full screen

Can you really? Full screen, not full viewport.

<:-)

Kalcifer Kandari

unread,
May 21, 2020, 6:23:06 PM5/21/20
to TiddlyWikiDocs
Can you really? Full screen, not full viewport.

See what I'm saying? People don't know about this stuff.

Good solution found for the coding problem here. Ended up using a macro, bunch of action widgets, and CSS, but it's not bad.

Your request for hubs etc makes sense. I would really like it. But who would set it up and lead it? In contrast to Blender, there's no money involved in TW not even via ads.

We already have https://tiddlywiki.com/dev, don't we? We just need to make it better. How about I fork the whole thing, we edit it a bunch to get a decent structure going and update the existing docs, then make a pull request back to the main TiddlyWiki repository?

With regards to money, Blender recently upped their push to their development fund. TiddlyWiki could do something similar. Check this out https://fund.blender.org/, and compare it to this http://tiddlytools.com/fundraising.html, yikes. You think a full-time paid developer is possible for TiddlyWiki? Maybe not straight away, but if we make TiddlyWiki more presentable to a wider audience, then it has a good chance.

Also Riz, you think one of your themes would be good as a better default for https://tiddlywiki.com/ and https://tiddlywiki.com/dev? You're the best at making them. Also, Riz, tutorial, hint hint, pretty pleeeease?

Kalcifer
Reply all
Reply to author
Forward
0 new messages