GithubHelp home page GithubHelp logo

isosphere / logseq-journals-nextprev Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 3.02 MB

Provides buttons to jump to the next or previous journal entry

License: MIT License

HTML 3.76% JavaScript 26.21% Vue 61.94% CSS 8.08%
logseq logseq-plugin

logseq-journals-nextprev's Introduction

I'm a software developer that aims to create reliable and efficient software.

As a software developer I have:

I think these public issues are a good example of my work ethic and process:

Contact

You can find my Linked In profile here, you should also see my e-mail in the panel on the left.

I run a Mastodon instance for Atlantic Canada.

New Clients

I am available for contract work; my customers are small businesses that rely on Excel and manual data manipulation/entry. I automate their processes to ensure that their data is serving them - too many serve their data.

I operate under Data Heck.

logseq-journals-nextprev's People

Contributors

abhinav avatar huaouo avatar isosphere avatar mbudde avatar sethyuan avatar vitor12xx avatar xxchan avatar xyhp915 avatar yu000jp avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

yu000jp

logseq-journals-nextprev's Issues

Doesn't work with journals

Currently, It only works on single page. It is possible to make the back button function assuming today's date, on journals. I can make a pull request.

An expensive query is run on every click

Running these queries fresh on every click is unnecessarily expensive:

async _getNewerJournals(currentJournalDate) {
let ret
try {
ret = await logseq.DB.datascriptQuery(`
[:find (pull ?p [*])
:where
[?b :block/page ?p]
[?p :block/journal? true]
[?p :block/journal-day ?d]
[(> ?d ${currentJournalDate})]]
`)
} catch (e) {
console.error(e)
}
return this._cleanJournalQueryReturn(ret)
},
async _getOlderJournals(currentJournalDate) {
let ret
try {
ret = await logseq.DB.datascriptQuery(`
[:find (pull ?p [*])
:where
[?b :block/page ?p]
[?p :block/journal? true]
[?p :block/journal-day ?d]
[(< ?d ${currentJournalDate})]]
`)
} catch (e) {
console.error(e)
}
return this._cleanJournalQueryReturn(ret)
},

We need only to cache the result and, if the appropriate hooks are available, hook into new journal creation or existing journal deletion to update the cache.

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.