mirror of
https://git.proxmox.com/git/pve-docs
synced 2025-08-07 12:07:20 +00:00
new file pve-docs-mediawiki-import.in
And use auto-generated data from link-refs.json. Also avoid strange file names.
This commit is contained in:
parent
cb84ed187a
commit
b489b02c74
35
Makefile
35
Makefile
@ -169,16 +169,21 @@ asciidoc-pve: asciidoc-pve.in link-refs.json
|
|||||||
chmod +x asciidoc-pve.tmp
|
chmod +x asciidoc-pve.tmp
|
||||||
mv asciidoc-pve.tmp asciidoc-pve
|
mv asciidoc-pve.tmp asciidoc-pve
|
||||||
|
|
||||||
|
pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json
|
||||||
|
cat pve-docs-mediawiki-import.in link-refs.json > pve-docs-mediawiki-import.tmp
|
||||||
|
chmod +x pve-docs-mediawiki-import.tmp
|
||||||
|
mv pve-docs-mediawiki-import.tmp pve-docs-mediawiki-import
|
||||||
|
|
||||||
test: asciidoc-pve
|
test: asciidoc-pve
|
||||||
./asciidoc-pve compile-wiki-section pve-package-repos.adoc
|
./asciidoc-pve compile-wiki-section pve-package-repos.adoc
|
||||||
#./asciidoc-pve compile-wiki-chapter ha-manager.adoc
|
#./asciidoc-pve compile-wiki-chapter ha-manager.adoc
|
||||||
|
|
||||||
WIKI_IMPORTS= \
|
WIKI_IMPORTS= \
|
||||||
section-pve-usbstick-plain.html \
|
pve-usbstick-plain.html \
|
||||||
section-getting-help-plain.html \
|
getting-help-plain.html \
|
||||||
section-pve-system-requirements-plain.html \
|
pve-system-requirements-plain.html \
|
||||||
$(addsuffix -plain.html, $(addprefix sysadmin-, ${SYSADMIN_PARTS})) \
|
$(addsuffix -plain.html, ${SYSADMIN_PARTS}) \
|
||||||
$(addsuffix -plain.html, $(addprefix chapter-, ${CHAPTER_LIST})) \
|
$(addsuffix -plain.html, ${CHAPTER_LIST}) \
|
||||||
$(addsuffix .5-plain.html, ${CONFIG_LIST}) \
|
$(addsuffix .5-plain.html, ${CONFIG_LIST}) \
|
||||||
$(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES}))
|
$(addsuffix -plain.html, $(addprefix pve-storage-, ${STORAGE_TYPES}))
|
||||||
|
|
||||||
@ -203,23 +208,14 @@ all: index.html
|
|||||||
%-nwdiag.svg: %.nwdiag
|
%-nwdiag.svg: %.nwdiag
|
||||||
nwdiag -T svg $*.nwdiag -o $@;
|
nwdiag -T svg $*.nwdiag -o $@;
|
||||||
|
|
||||||
sysadmin-%-plain.html: asciidoc-pve %.adoc
|
%-plain.html: asciidoc-pve %.adoc
|
||||||
./asciidoc-pve compile-wiki-section -o $@ $*.adoc
|
./asciidoc-pve compile-wiki -o $@ $*.adoc
|
||||||
|
|
||||||
section-%-plain.html: asciidoc-pve %.adoc
|
chapter-sysadmin.html sysadmin-plain.html: ${SYSADMIN_SOURCES}
|
||||||
./asciidoc-pve compile-wiki-section -o $@ $*.adoc
|
|
||||||
|
|
||||||
chapter-sysadmin.html chapter-sysadmin-plain.html: ${SYSADMIN_SOURCES}
|
|
||||||
|
|
||||||
chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
|
chapter-%.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
|
||||||
asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc
|
asciidoc ${ADOC_STDARG} -a toc -o $@ $*.adoc
|
||||||
|
|
||||||
chapter-%-plain.html: %.adoc ${PVE_COMMON_DOC_SOURCES}
|
|
||||||
./asciidoc-pve compile-wiki-chapter -o $@ $*.adoc
|
|
||||||
|
|
||||||
pve-storage-%-plain.html: pve-storage-%.adoc ${PVE_COMMON_DOC_SOURCES}
|
|
||||||
./asciidoc-pve compile-wiki-section -o $@ pve-storage-$*.adoc
|
|
||||||
|
|
||||||
%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
|
%.1.html: %.adoc %.1-synopsis.adoc ${PVE_COMMON_DOC_SOURCES}
|
||||||
asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
|
asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
|
||||||
|
|
||||||
@ -277,10 +273,11 @@ deb:
|
|||||||
rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
|
rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
|
||||||
make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
|
make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
|
||||||
|
|
||||||
${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES}
|
${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import
|
||||||
rm -rf build
|
rm -rf build
|
||||||
mkdir build
|
mkdir build
|
||||||
rsync -a debian/ build/debian
|
rsync -a debian/ build/debian
|
||||||
|
cp pve-docs-mediawiki-import build/debian/tree/pve-docs-mediawiki/pve-docs-mediawiki-import
|
||||||
echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
|
echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
|
||||||
# install files for pve-doc-generator package
|
# install files for pve-doc-generator package
|
||||||
mkdir -p build/usr/share/${GEN_PACKAGE}
|
mkdir -p build/usr/share/${GEN_PACKAGE}
|
||||||
@ -313,5 +310,5 @@ update: clean
|
|||||||
make all
|
make all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_*
|
rm -rf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import
|
||||||
find . -name '*~' -exec rm {} ';'
|
find . -name '*~' -exec rm {} ';'
|
||||||
|
@ -162,11 +162,8 @@ sub compile_wiki {
|
|||||||
|
|
||||||
my $leveloffset = 0;
|
my $leveloffset = 0;
|
||||||
|
|
||||||
if ($clicmd eq 'compile-wiki-chapter') {
|
my $doctype = $fileinfo->{doctype}->{$env}->{$infile} // 0;
|
||||||
$leveloffset = 0;
|
$leveloffset = - $doctype;
|
||||||
} elsif ($clicmd eq 'compile-wiki-section') {
|
|
||||||
$leveloffset = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $date = `date`;
|
my $date = `date`;
|
||||||
chomp $date;
|
chomp $date;
|
||||||
@ -211,8 +208,7 @@ sub compile_wiki {
|
|||||||
die "aciidoc error";
|
die "aciidoc error";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clicmd eq 'compile-wiki-chapter' ||
|
if ($clicmd eq 'compile-wiki') {
|
||||||
$clicmd eq 'compile-wiki-section') {
|
|
||||||
|
|
||||||
eval { compile_wiki(); };
|
eval { compile_wiki(); };
|
||||||
my $err = $@;
|
my $err = $@;
|
||||||
|
@ -8,6 +8,13 @@ use IO::File;
|
|||||||
use File::Basename;
|
use File::Basename;
|
||||||
use MediaWiki::API;
|
use MediaWiki::API;
|
||||||
|
|
||||||
|
use JSON;
|
||||||
|
|
||||||
|
my $data_str = "";
|
||||||
|
while (<main::DATA>) { $data_str .= $_; }
|
||||||
|
|
||||||
|
my $fileinfo = decode_json($data_str);
|
||||||
|
|
||||||
my $config_fn = "/root/.pve-docs"; # format 'username:pw'
|
my $config_fn = "/root/.pve-docs"; # format 'username:pw'
|
||||||
|
|
||||||
my $fh = IO::File->new("$config_fn") ||
|
my $fh = IO::File->new("$config_fn") ||
|
||||||
@ -63,88 +70,88 @@ sub update_page {
|
|||||||
|
|
||||||
my $cat_refdoc = "Reference Documentation";
|
my $cat_refdoc = "Reference Documentation";
|
||||||
|
|
||||||
my $docs = {
|
my $docs_old = {
|
||||||
'chapter-ha-manager-plain.html' => {
|
'ha-manager-plain.html' => {
|
||||||
title => "High Availability",
|
title => "High Availability",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pve-installation-plain.html' => {
|
'pve-installation-plain.html' => {
|
||||||
title => "Installation",
|
title => "Installation",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'section-pve-usbstick-plain.html' => {
|
'pve-usbstick-plain.html' => {
|
||||||
title => "Install from USB Stick",
|
title => "Install from USB Stick",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'section-pve-system-requirements-plain.html' => {
|
'pve-system-requirements-plain.html' => {
|
||||||
title => "System Requirements",
|
title => "System Requirements",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'section-getting-help-plain.html' => {
|
'getting-help-plain.html' => {
|
||||||
title => "Getting Help",
|
title => "Getting Help",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'sysadmin-pve-network-plain.html' => {
|
'pve-network-plain.html' => {
|
||||||
title => "Network Configuration",
|
title => "Network Configuration",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'sysadmin-pve-disk-health-monitoring-plain.html' => {
|
'pve-disk-health-monitoring-plain.html' => {
|
||||||
title => "Disk Health Monitoring",
|
title => "Disk Health Monitoring",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'sysadmin-local-lvm-plain.html' => {
|
'local-lvm-plain.html' => {
|
||||||
title => "Logical Volume Manager (LVM)",
|
title => "Logical Volume Manager (LVM)",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'sysadmin-pve-package-repos-plain.html' => {
|
'pve-package-repos-plain.html' => {
|
||||||
title => "Package Repositories",
|
title => "Package Repositories",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'sysadmin-system-software-updates-plain.html' => {
|
'system-software-updates-plain.html' => {
|
||||||
title => "System Software Updates",
|
title => "System Software Updates",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-sysadmin-plain.html' => {
|
'sysadmin-plain.html' => {
|
||||||
title => "Host System Administration",
|
title => "Host System Administration",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pct-plain.html' => {
|
'pct-plain.html' => {
|
||||||
title => "Linux Container",
|
title => "Linux Container",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pmxcfs-plain.html' => {
|
'pmxcfs-plain.html' => {
|
||||||
title => "Proxmox Cluster File System (pmxcfs)",
|
title => "Proxmox Cluster File System (pmxcfs)",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pve-bibliography-plain.html' => {
|
'pve-bibliography-plain.html' => {
|
||||||
title => "Bibliography",
|
title => "Bibliography",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pvecm-plain.html' => {
|
'pvecm-plain.html' => {
|
||||||
title => "Cluster Manager",
|
title => "Cluster Manager",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pve-faq-plain.html' => {
|
'pve-faq-plain.html' => {
|
||||||
title => "FAQ",
|
title => "FAQ",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pve-firewall-plain.html' => {
|
'pve-firewall-plain.html' => {
|
||||||
title => "Firewall",
|
title => "Firewall",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pvesm-plain.html' => {
|
'pvesm-plain.html' => {
|
||||||
title => "Storage",
|
title => "Storage",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-pveum-plain.html' => {
|
'pveum-plain.html' => {
|
||||||
title => "User Management",
|
title => "User Management",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-qm-plain.html' => {
|
'qm-plain.html' => {
|
||||||
title => "Qemu/KVM Virtual Machines",
|
title => "Qemu/KVM Virtual Machines",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
'chapter-vzdump-plain.html' => {
|
'vzdump-plain.html' => {
|
||||||
title => "Backup and Restore",
|
title => "Backup and Restore",
|
||||||
category => $cat_refdoc,
|
category => $cat_refdoc,
|
||||||
},
|
},
|
||||||
@ -199,15 +206,30 @@ my $docs = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#update_page("testpage1", $filename, $d->{category});
|
my $wiki_man5_pages = {
|
||||||
|
'datacenter.cfg.adoc' => 1,
|
||||||
|
'qm.conf.adoc' => 1,
|
||||||
|
'pct.conf.adoc' => 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
my $docs = {};
|
||||||
|
foreach my $source (sort keys %{$fileinfo->{toplevel}->{wiki}}) {
|
||||||
|
my $title = $fileinfo->{titles}->{wiki}->{$source};
|
||||||
|
my $doctype = $fileinfo->{doctype}->{wiki}->{$source};
|
||||||
|
|
||||||
|
my $suffix = $wiki_man5_pages->{$source} ? '.5-plain.html' : '-plain.html';
|
||||||
|
my $filename = $source;
|
||||||
|
$filename =~ s/\.adoc//;
|
||||||
|
$filename .= $suffix;
|
||||||
|
|
||||||
foreach my $filename (keys %$docs) {
|
|
||||||
my $path = "/usr/share/pve-docs/$filename";
|
my $path = "/usr/share/pve-docs/$filename";
|
||||||
die "no such file '$path'" if ! -f $path;
|
die "no such file '$path'" if ! -f $path;
|
||||||
my $d = $docs->{$filename};
|
|
||||||
update_page($d->{title}, $filename, $d->{category});
|
update_page($title, $filename, category => $cat_refdoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
# also update 'Get support' page, because this is used since a long
|
# also update 'Get support' page, because this is used since a long
|
||||||
# time and is referenced from outside
|
# time and is referenced from outside
|
||||||
update_page("Get support", 'sysadmin-getting-help-plain.html', 'HOWTO');
|
update_page("Get support", 'getting-help-plain.html', 'HOWTO');
|
||||||
|
|
||||||
|
__END__
|
Loading…
Reference in New Issue
Block a user