FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gitlogdiff.nvim/lua/gitlogdiff/docs.lua at main · Salanoid/gitlogdiff.nvim · GitHub
Salanoid
/
gitlogdiff.nvim
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
24
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gitlogdiff.nvim
/
lua
/
gitlogdiff
/
docs.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (79 loc) · 2.52 KB
Breadcrumbs
gitlogdiff.nvim
/
lua
/
gitlogdiff
/
docs.lua
Copy path
File metadata and controls
90 lines (79 loc) · 2.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
local
Docs
=
require
(
"
lazy.docs
"
)
local
M
=
{}
function
M
.
suggested
()
return
{
"
Salanoid/gitlogdiff.nvim
"
,
main
=
"
gitlogdiff
"
,
dependencies
=
{
"
sindrets/diffview.nvim
"
,
},
cmd
=
"
GitLogDiff
"
,
opts
=
{
max_count
=
300
},
}
end
function
M
.
update
()
local
name
=
"
gitlogdiff
"
--
Update README.md
Docs
.
save
({
suggested
=
{
content
=
[[
{
"Salanoid/gitlogdiff.nvim",
main = "gitlogdiff",
dependencies = {
"sindrets/diffview.nvim",
},
cmd = "GitLogDiff",
opts = { max_count = 300 },
}
]]
,
lang
=
"
lua
"
,
},
})
--
Generate Vimdocs
local
readme
=
vim
.
fn
.
readfile
(
"
README.md
"
)
local
lines
=
{}
table.insert
(
lines
,
"
*
"
..
name
..
"
.txt* Recent Git commits and diffs
"
)
table.insert
(
lines
,
"
"
)
table.insert
(
lines
,
"
==============================================================================
"
)
table.insert
(
lines
,
"
INTRODUCTION *
"
..
name
..
"
-intro*
"
)
table.insert
(
lines
,
"
"
)
local
in_code_block
=
false
for
_
,
line
in
ipairs
(
readme
)
do
if
line
:
find
(
"
^<!%-%-
"
)
then
--
Skip HTML comments
elseif
line
:
find
(
"
^```
"
)
then
in_code_block
=
not
in_code_block
table.insert
(
lines
,
in_code_block
and
"
>
"
or
"
<
"
)
elseif
line
:
find
(
"
^%s*#
"
)
then
--
Skip
elseif
line
:
find
(
"
^%s*%[!%[
"
)
then
--
Skip badges
elseif
line
:
find
(
"
^##
"
)
then
local
title
=
line
:
match
(
"
^## (.*)
"
)
local
tag
=
"
*
"
..
name
..
"
-
"
..
title
:
lower
():
gsub
(
"
[%s/]+
"
,
"
-
"
):
gsub
(
"
%-+$
"
,
"
"
)
..
"
*
"
table.insert
(
lines
,
"
"
)
table.insert
(
lines
,
"
==============================================================================
"
)
table.insert
(
lines
,
title
:
upper
()
..
string.rep
(
"
"
,
78
-
#
title
-
#
tag
)
..
tag
)
table.insert
(
lines
,
"
"
)
elseif
line
:
find
(
"
^###
"
)
then
local
title
=
line
:
match
(
"
^### (.*)
"
)
local
tag
=
"
*
"
..
name
..
"
-
"
..
title
:
lower
():
gsub
(
"
[%s/]+
"
,
"
-
"
):
gsub
(
"
%-+$
"
,
"
"
)
..
"
*
"
table.insert
(
lines
,
"
"
)
table.insert
(
lines
,
title
..
string.rep
(
"
"
,
78
-
#
title
-
#
tag
)
..
tag
)
table.insert
(
lines
,
"
"
)
else
if
not
in_code_block
then
line
=
line
:
gsub
(
"
%%
"
,
"
%%%%
"
)
line
=
line
:
gsub
(
"
%[(.-)%]%(.-%)
"
,
"
%1
"
)
line
=
line
:
gsub
(
"
%[(.-)%]
"
,
"
%1
"
)
line
=
line
:
gsub
(
"
`(.-)`
"
,
"
%1
"
)
end
table.insert
(
lines
,
line
)
end
end
table.insert
(
lines
,
"
"
)
table.insert
(
lines
,
"
vim:tw=78:ts=8:ft=help:norl:
"
)
vim
.
fn
.
mkdir
(
"
doc
"
,
"
p
"
)
vim
.
fn
.
writefile
(
lines
,
"
doc/
"
..
name
..
"
.txt
"
)
end
M
.
update
()
return
M
Back
|
FazBrowse Home
|
New Git URL