Code Monkey home page Code Monkey logo

Comments (3)

bwanders avatar bwanders commented on June 12, 2024

Your first question requires some thinking, but I'm sure there's a way that only requires a few simple things to get the "relative to now" thing working. I will write up a proof of concept tomorrow, and explain why it works.

To answer your question in the entry title field. The links to other data are given captions based on dokuwiki's own useheading setting. I'm guessing your wiki uses the 'Never' setting, so all links show their name as the page ID. Strata respects this setting, so if you change it to 'content' or higher, you'll automatically see nicer links using the entry title field as the caption.

Furthermore, the entry title field is automatically filled based on the title of the page the datablock is on (or the fragment that is used to identify the data block). For example:

<data TODO>
</data>

Would be enough to give the page an entry title. The entry title would then be equal to the page's title as dokuwiki sees it -- which is the first header on the page. You can override this behaviour by giving an entry title yourself, the entry title you give will be used for the block.

from dokuwiki-strata.

bwanders avatar bwanders commented on June 12, 2024

The query building is really low-level, and should not really be touched. Unless you want to add either new comparison operators, or to change the semantics of the query language itself, there should be another way get what you want.

For most value-related things, such as the relative times, the only change needed is the implementation of a type. The idea behind types in Strata is that they form a kind of layer around the low-level querying mechanism. The types are used for normalisation of user input (when a string in the query or data entry goes into the database), and for the display of values (when a string comes from a query and goes to the browser).

Your idea of 'TODAY+7days' is a good example of a string of user input. A type can easily handle that by normalizing it to the internal time format (which you correctly found is the unix timestamp).

As a proof of concept, I have written a relativedate type that allows you to do both the comparison you are looking for, and to also display times relative to the current time (like "in 3 days", "in 4 hours", "2 hours ago", etc.). Because I realised that people leave open their browser tabs a lot, I've also made sure that the displayed time difference updates through a short piece of javascript...

You can find this type in the dokuwiki-plugin-stratatimetypes plugin. The readme over there should get you going.

Let me know if that helps! And if it does, feel free to close this issue.

from dokuwiki-strata.

simon-r-white avatar simon-r-white commented on June 12, 2024

That's brilliant. Many thanks for doing that so quickly.

I can honestly say that with your strata plugin, dokuwiki is the best thing ever... I'm now using it to organise everything I do at work.

Again, thank you very much.

(Also, thanks for the answer on the useheadings setting... didn't realise strata obeyed that setting).

from dokuwiki-strata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.