Skip to content

Commit

Permalink
chore(docs): auto generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored and github-actions[bot] committed Feb 23, 2024
1 parent c561bbf commit 62077b5
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/obsidian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,10 @@ carefully and customize it to your needs:
-- You can always override this per image by passing a full path to the command instead of just a filename.
img_folder = "assets/imgs", -- This is the default
-- A function that determines the text to insert in the note when pasting an image.
-- It takes two arguments, the `obsidian.Client` and a plenary `Path` to the image file.
-- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file.
-- This is the default implementation.
---@param client obsidian.Client
---@param path Path the absolute path to the image file
---@param path obsidian.Path the absolute path to the image file
---@return string
img_text_func = function(client, path)
local link_path
Expand Down
227 changes: 227 additions & 0 deletions doc/obsidian_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -916,4 +916,231 @@ Parameters ~
Return ~
obsidian.Workspace| `(optional)`

------------------------------------------------------------------------------
*obsidian.cached_get()*
`cached_get`({path}, {k}, {factory})
Parameters ~
{path} `(table)`
{k} `(string)`
{factory} `(fun(obsidian.Path): any)`

------------------------------------------------------------------------------
*obsidian.Path*
`Path`
A Path class that provides a subset of the functionality of the Python pathlib library while
staying true to its API. It improves on a number of bugs in plenary.path.

Class ~
{obsidian.Path} : obsidian.ABC

Fields ~
{filename} `(string)` The underlying filename as a string.
{name} `(string|?)` The final path component, if any.
{suffix} `(string|?)` The final extension of the path, if any.
{suffixes} `(string[])` A list of all of the path's extensions.
{stem} `(string|?)` The final path component, without its suffix.

------------------------------------------------------------------------------

Constructors.


------------------------------------------------------------------------------
*obsidian.Path.new()*
`Path.new`({...})
Create a new path from a string.

Parameters ~
{...} `(string|obsidian.Path)`

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.temp()*
`Path.temp`()
Get a temporary path with a unique name.

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.cwd()*
`Path.cwd`()
Get a path corresponding to the current working directory as given by `vim.loop.cwd()`.

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.buffer()*
`Path.buffer`({bufnr})
Get a path corresponding to a buffer.

Parameters ~
{bufnr} `(integer|?)` The buffer number or `0` / `nil` for the current buffer.

Return ~
obsidian.Path

------------------------------------------------------------------------------

Pure path methods.


------------------------------------------------------------------------------
*obsidian.Path.with_suffix()*
`Path.with_suffix`({self}, {suffix})
Return a new path with the suffix changed.

Parameters ~
{suffix} `(string)`

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.is_absolute()*
`Path.is_absolute`({self})
Returns true if the path is already in absolute form.

Return ~
`(boolean)`

------------------------------------------------------------------------------
*obsidian.Path.joinpath()*
`Path.joinpath`({self}, {...})
Parameters ~
{...} `(obsidian.Path|string)`
Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.relative_to()*
`Path.relative_to`({self}, {other})
Try to resolve a version of the path relative to the other.
An error is raised when it's not possible.

Parameters ~
{other} `(obsidian.Path|string)`

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.parent()*
`Path.parent`({self})
The logical parent of the path.

Return ~
obsidian.Path| `(optional)`

------------------------------------------------------------------------------
*obsidian.Path.parents()*
`Path.parents`({self})
Get a list of the parent directories.

Return ~
obsidian.Path[]

------------------------------------------------------------------------------
*obsidian.Path.is_parent_of()*
`Path.is_parent_of`({self}, {other})
Check if the path is a parent of other.

Parameters ~
{other} `(obsidian.Path|string)`

Return ~
`(boolean)`

------------------------------------------------------------------------------

Concrete path methods.


------------------------------------------------------------------------------
*obsidian.Path.resolve()*
`Path.resolve`({self}, {opts})
Make the path absolute, resolving any symlinks.
If `strict` is true and the path doesn't exist, an error is raised.

Parameters ~
{opts} { strict: `(boolean)` }|?

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.stat()*
`Path.stat`({self})
Get OS stat results.

Return ~
`(table|)` `(optional)`

------------------------------------------------------------------------------
*obsidian.Path.exists()*
`Path.exists`({self})
Check if the path points to an existing file or directory.

Return ~
`(boolean)`

------------------------------------------------------------------------------
*obsidian.Path.is_file()*
`Path.is_file`({self})
Check if the path points to an existing file.

Return ~
`(boolean)`

------------------------------------------------------------------------------
*obsidian.Path.is_dir()*
`Path.is_dir`({self})
Check if the path points to an existing directory.

Return ~
`(boolean)`

------------------------------------------------------------------------------
*obsidian.Path.mkdir()*
`Path.mkdir`({self}, {opts})
Create a new directory at the given path.

Parameters ~
{opts} { mode: `(integer|?,)` parents: boolean|?, exist_ok: boolean|? }|?

------------------------------------------------------------------------------
*obsidian.Path.rmdir()*
`Path.rmdir`({self})
Remove the corresponding directory.

------------------------------------------------------------------------------
*obsidian.Path.touch()*
`Path.touch`({self}, {opts})
Create a file at this given path.

Parameters ~
{opts} { mode: `(integer|?,)` exist_ok: boolean|? }|?

------------------------------------------------------------------------------
*obsidian.Path.rename()*
`Path.rename`({self}, {target})
Rename this file or directory to the given target.

Parameters ~
{target} `(obsidian.Path|string)`

Return ~
obsidian.Path

------------------------------------------------------------------------------
*obsidian.Path.unlink()*
`Path.unlink`({self}, {opts})
Remove the file.

Parameters ~
{opts} { missing_ok: `(boolean|?)` }|?

vim:tw=78:ts=8:noet:ft=help:norl:

0 comments on commit 62077b5

Please sign in to comment.