Skip to content
Snippets Groups Projects
Commit e4093d38 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Make it work on windows

parent 44491ca1
No related branches found
No related tags found
No related merge requests found
Tento software pro psaní článků NENÍ nutné instalovat.
Články můžete psát přímo z [webového rozhraní](https://git.ok1kvk.cz/ok1kvk.cz/content)
# Jak to zprovoznit na fedoře
# Přidat repozitář nodejs - ve fedoře je verze 0.10.x
......@@ -5,3 +7,20 @@
sudo dnf -y install nodejs git
./configure.sh
node index.js
# Jak to zprovoznit na windows
* Budeme potřebovat [git](https://git-scm.com/download/win)
* Dále budeme potřebovat [nodejs](https://nodejs.org/en/) - stáhněte si tu verzi,
na které je nápis LTS.
* U obou nástrojů silně doporučuji neměnit žádná nastavení!
Po instalaci obou věcí přejděte do nějaké složky pomocí průzkumníka a klikněte na
`git bash`. Pak napište následující:
git clone https://git.ok1kvk.cz/ok1kvk.cz/generator.git
cd generator
bash configure.sh
node index.js
Nyní otevřete prohlížeč a přejděte na [localhost:1337](http://localhost:1337)
......@@ -37,7 +37,7 @@ var readPageWorker = function(file, articleName, contentDir) {
obj.file = articleName.replace("articles","clanek");
obj.content = file.substring(fm_end+4);
try {
obj.metadata = toml.parse(file.substring(0,fm_end-1));
obj.metadata = toml.parse(file.substring(0,fm_end-1)+"\n");
} catch(e) {
console.log(articleName+": Failed to parse metadata");
throw e;
......@@ -117,4 +117,3 @@ module.exports = function(_contentDir) {
});
};
}
......@@ -60,13 +60,13 @@ var getFilesHistory = function() {
diffs.forEach(function(data) {
var commit = data[1];
var diff = data[0];
diff.forEach(function(entry) {
var path = entry.newFile().path();
if(filehistory[path]===undefined) {
filehistory[path] = [];
var p = path.normalize(entry.newFile().path());
if(filehistory[p]===undefined) {
filehistory[p] = [];
}
filehistory[path].push(commit);
filehistory[p].push(commit);
});
});
return filehistory;
......@@ -76,7 +76,7 @@ var getFilesHistory = function() {
module.exports = function() {
var tr = this;
tr.fancyname = "transformer git";
tr.pre = function(cb, articleList) {
getFilesHistory()
.then((filesHistory) => {
......@@ -90,7 +90,7 @@ module.exports = function() {
if(commits !== undefined) {
var newestCommit = commits[0];
var oldestCommit = commits[commits.length-1];
if(article.metadata.date == undefined)
article.metadata.date = {};
......@@ -109,16 +109,15 @@ module.exports = function() {
article.commits = commits;
}
todo--;
if(todo == 0) cb();
});
})
.catch(function(err) {console.log(err.stack);});
}
tr.forEachPage = function(article, cb) {
cb();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment