Two birds with one stone? "Page focus" (?) link to a page, and "intertransclusion" (?) #57

Open
opened 3 months ago by CharlieJV · 4 comments

It would be cool if something in a URL could trigger a focused view of a page (i.e. no sidebar).

For example: ...// feather.wiki / ?plainpage=navigating

Then, it would be cool if we could have "intertransclusion" (?) between FeatherWiki instances.

For example: {{...// feather.wiki / ?plainpage=navigating}}

Because FeatherWiki is so light, transcluding page content from another FeatherWiki seems like something feasible and oh-so-appealing.

Only if it is interesting for you to tackle without any back-breaking.

It would be cool if something in a URL could trigger a focused view of a page (i.e. no sidebar). For example: ...// feather.wiki / ?plainpage=navigating Then, it would be cool if we could have "intertransclusion" (?) between FeatherWiki instances. For example: {{...// feather.wiki / ?plainpage=navigating}} Because FeatherWiki is so light, transcluding page content from another FeatherWiki seems like something feasible and oh-so-appealing. Only if it is interesting for you to tackle without any back-breaking.
CharlieJV added the
request
label 3 months ago
CharlieJV changed title from Two birds with one stone? "Page view" (?) link to a page, and "Page view" (?) transclusion of a page to Two birds with one stone? "Page focus" (?) link to a page, and "intertransclusion" (?) 3 months ago
Alamantus added the
help wanted
extension
labels 3 months ago

I wrote a short snippet that you can drop into the Custom JS section of Wiki Settings.

/**FW#57*/
(()=>{window.FW.use((state, emitter, app)=>{if(state.query.sidebar=='hide')emitter.on('render',()=>setTimeout(()=>{if (!document.getElementById('hs'))document.body.appendChild(window.html`<style id='hs'>.sb{display:none!important;}</style>`);},0));});})();

It does cause a bit of flickering, but I'm not entirely sure how I can address that.

I wrote a short snippet that you can drop into the Custom JS section of Wiki Settings. ```js /**FW#57*/ (()=>{window.FW.use((state, emitter, app)=>{if(state.query.sidebar=='hide')emitter.on('render',()=>setTimeout(()=>{if (!document.getElementById('hs'))document.body.appendChild(window.html`<style id='hs'>.sb{display:none!important;}</style>`);},0));});})(); ``` It does cause a bit of flickering, but I'm not entirely sure how I can address that.

Looking through FeatherWiki source, there is a sb value in global state, commented with // show sidebar. However, testing shows that this value does not affect the sidebar visibility. If I load https://feather.wiki, and check the value of FW.state.sb, it is set to false. However, the sidebar is still visible. (Changing FW.state.sb to true didn't have any visible effects, either.)

Looking through FeatherWiki source, there is a `sb` value in global state, commented with `// show sidebar`. However, testing shows that this value does not affect the sidebar visibility. If I load https://feather.wiki, and check the value of `FW.state.sb`, it is set to `false`. However, the sidebar is still visible. (Changing `FW.state.sb` to `true` didn't have any visible effects, either.)

I've uploaded the snippet to Github Pages. Instead of pasting the above snippet into Custom JS, you can paste the following below:

document.body.appendChild(html`<script src="https://pythonmcpi.github.io/fw_ext/hide_sidebar.min.js"><\/script>`);

You'll get automatic updates if I fix any bugs with the snippet, or if I manage to remove flickering. However, you'll need internet to load the extension if you load from Github Pages.

I've uploaded the snippet to Github Pages. Instead of pasting the above snippet into Custom JS, you can paste the following below: ```js document.body.appendChild(html`<script src="https://pythonmcpi.github.io/fw_ext/hide_sidebar.min.js"><\/script>`); ``` You'll get automatic updates if I fix any bugs with the snippet, or if I manage to remove flickering. However, you'll need internet to load the extension if you load from Github Pages.
Owner

Looking through FeatherWiki source, there is a sb value in global state, commented with // show sidebar. However, testing shows that this value does not affect the sidebar visibility. If I load https://feather.wiki, and check the value of FW.state.sb, it is set to false. However, the sidebar is still visible. (Changing FW.state.sb to true didn't have any visible effects, either.)

The sb variable is only used for the mobile view when toggling the menu, which is hidden by default.

> Looking through FeatherWiki source, there is a `sb` value in global state, commented with `// show sidebar`. However, testing shows that this value does not affect the sidebar visibility. If I load https://feather.wiki, and check the value of `FW.state.sb`, it is set to `false`. However, the sidebar is still visible. (Changing `FW.state.sb` to `true` didn't have any visible effects, either.) The `sb` variable is only used for the mobile view when toggling the menu, which is hidden by default.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Reference: Alamantus/FeatherWiki#57
Loading…
There is no content yet.