Skip to content

Commit

Permalink
various updates, esp. to layout
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Nov 16, 2024
1 parent d5f1708 commit e8e6850
Show file tree
Hide file tree
Showing 77 changed files with 3,545 additions and 1,624 deletions.
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if coand -v nix-shell &> /dev/null
then
use_flake
fi
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/bin/word binary
12 changes: 12 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: docgen (oneday)

on:
pull_request:
push:
branches:
- master

jobs:
steps:
- name: empty
run: echo "empty"
17 changes: 17 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: nix
on:
pull_request:
push:
branches:
- master
jobs:
steps:
- name: empty
run: echo "empty
# - uses: actions/checkout@v3
# - run: date +%F > todays-date
# - name: restore from todays cache
# uses: actions/cache@v3
# with:
# path: _neovim
# key: ${{ runner.os }}-${{ matrix.rev }}-${{ hashFiles('todays-date') }}
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test (one day)


on:
pull_request:
push:
branches:
- master

jobs:
steps:
- name: empty
run: echo "empty"
14 changes: 0 additions & 14 deletions .null-ls_851613_flake.nix

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ check back!
thank you and keep updated!

- [The word book](https://word.cli.st)
- [word.lua on luarocks](https://luarocks.org/modules/clpi/word.lua)
- [word.lua on luarocks](https://luarocks.org/inits/clpi/word.lua)

<!-- <div align="center"> -->

Expand Down
2 changes: 1 addition & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Welcome to the `word.lua` book. I hope this helps!

4. [Extending](./extend.md)
1. [Plugins](./extend/plugins.md)
2. [Modules](./extend/modules.md)
2. [inits](./extend/inits.md)
3. [Keymaps](./extend/keymaps.md)
4. [Autocmds](./extend/autocmd.md)

Expand Down
3 changes: 3 additions & 0 deletions doc/tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
word-toc word.txt /*word table of contents*
word markdown.md /* the `.md` extension is used
word-link
36 changes: 0 additions & 36 deletions doc/word.lua.txt

This file was deleted.

6 changes: 0 additions & 6 deletions doc/word.md

This file was deleted.

86 changes: 86 additions & 0 deletions doc/word.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
*word.lua.txt* word.lua

Author: Chris Pecunies

TABLE OF CONTENTS *word.lua*
================================================================================

1. Introduction..........................................|word-intro|
2. About.................................................|word-about|
3. Todo..................................................|word-todo|
4. Links.................................................|word-links|

INTRODUCTION *word.lua*
================================================================================

`word.lua` is a plugin to bring the extensibility of org-mode to neovim without
leaving the gold standard markdown file format.

INSTALLATION *word-install*
================================================================================



SETUP *word-setup*
================================================================================

```lua
require("word").setup({
load = {
base = { },
workspace = {
config = {
workspaces = {
default = "~/word",
word = "~/word"
}
}
}

}
})
````

CONFIG *word-config*
================================================================================

OVERVIEW *word-about*
================================================================================

To be filled out

KEYMAPS *word-keymaps*
================================================================================

By default, the prefix is currently for major word.lua commands is mapped
to `\` but may be changed by setting `vim.g.word_leaer` in your config.`

----------------------------------------------------------------------------
| Mappings | Action |
----------------------------------------------------------------------------
| <leader>wt | Toggle todo |
| <leader>wn | Next todo |
| <leader>wp | Previous todo |
| <leader>wd | Delete todo |
----------------------------------------------------------------------------

TODO *word-todo*
================================================================================

- [ ] Separate commands and mods `(11/15 22:43)`
- [ ] Docgen `(11/15 22:43)`
- [ ] Easy linking of files by title, and easy colloqial hierarchy `(11/1522:43)`
- [ ] Easy tagging of tracked todos, easy disparate categ. of todos

LINKS *word-links*
================================================================================

Grab the latest version or report a bug on GitHub:

https://github.com/clpi/word.lua

Or visit the website:

https://word.clp.is

vim:tw=80:colorcolumn=81:et:ft=help:norl:
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions lua/word/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
--- | "linux"
--- | "bsd"

--- @alias word.configuration.module { config?: table }
--- @alias word.configuration.init { config?: table }

--- @class (exact) word.configuration.user
--- @field hook? fun(manual: boolean, arguments?: string) A user-defined function that is invoked whenever word starts up. May be used to e.g. set custom keybindings.
--- @field lazy_loading? boolean Whether to defer loading the word base until after the user has entered a `.word` file.
--- @field load table<string, word.configuration.module> A list of mod to load, alongside their configurations.
--- @field load table<string, word.configuration.init> A list of mod to load, alongside their configurations.
--- @field logger? word.log.configuration A configuration table for the logger.

--- @class (exact) word.configuration
--- @field arguments table<string, string> A list of arguments provided to the `:wordStart` function in the form of `key=value` pairs. Only applicable when `user_config.lazy_loading` is `true`.
--- @field manual boolean? Used if word was manually loaded via `:wordStart`. Only applicable when `user_config.lazy_loading` is `true`.
--- @field mod table<string, word.configuration.module> Acts as a copy of the user's configuration that may be modified at runtime.
--- @field mod table<string, word.configuration.init> Acts as a copy of the user's configuration that may be modified at runtime.
--- @field word_version string The version of the file format to be used throughout word. Used internally.
--- @field os_info OperatingSystem The operating system that word is currently running under.
--- @field pathsep "\\"|"/" The operating system that word is currently running under.
Expand Down
30 changes: 15 additions & 15 deletions lua/word/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local word = {

local config, log, mod, utils = word.config, word.log, word.mod, word.utils

--- @module "word.config"
--- @init "word.config"

--- Initializes word. Parses the supplied user configuration, initializes all selected mod and adds filetype checking for `.word`.
--- @param cfg word.configuration.user? A table that reflects the structure of `config.user_config`.
Expand Down Expand Up @@ -76,19 +76,19 @@ function word.setup(cfg)
})
end

-- Call Mod.load_modules to load all modules
mod.load_modules()
-- Call Mod.load_inits to load all inits
mod.load_inits()
end

--- This function gets called upon entering a .word file and loads all of the user-defined mod.
--- @param manual boolean If true then the environment was kickstarted manually by the user.
--- @param arguments string? A list of arguments in the format of "key=value other_key=other_value".
function word.org_file_entered(manual, arguments)
-- Extract the module list from the user config
local module_list = config.user_config and config.user_config.load or {}
-- Extract the init list from the user config
local init_list = config.user_config and config.user_config.load or {}

-- If we have already started word or if we haven't defined any mod to load then bail
if config.started or not module_list or vim.tbl_isempty(module_list) then
if config.started or not init_list or vim.tbl_isempty(init_list) then
return
end

Expand All @@ -108,25 +108,25 @@ function word.org_file_entered(manual, arguments)
end
end

-- Go through each defined module and grab its config
for name, module in pairs(module_list) do
-- Go through each defined init and grab its config
for name, init in pairs(init_list) do
-- Apply the config
config.mod[name] = vim.tbl_deep_extend("force", config.mod[name] or {}, module.config or {})
config.mod[name] = vim.tbl_deep_extend("force", config.mod[name] or {}, init.config or {})
end

-- After all config are merged proceed to actually load the mod
local load_module = mod.load_module
for name, _ in pairs(module_list) do
local load_init = mod.load_init
for name, _ in pairs(init_list) do
-- If it could not be loaded then halt
if not load_module(name) then
if not load_init(name) then
log.warn("Recovering from error...")
mod.loaded_mod[name] = nil
end
end

-- Goes through each loaded module and invokes word_post_load()
for _, module in pairs(mod.loaded_mod) do
module.word_post_load()
-- Goes through each loaded init and invokes word_post_load()
for _, init in pairs(mod.loaded_mod) do
init.word_post_load()
end

-- Set this variable to prevent word from loading twice
Expand Down
Empty file added lua/word/mod/agenda/init.lua
Empty file.
Empty file.
Empty file.
Empty file added lua/word/mod/auto/init.lua
Empty file.
Empty file.
Loading

0 comments on commit e8e6850

Please sign in to comment.