Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Transcript Postprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FS Info TU Dortmund
Fachschaftsrat
Tools
Transcript Postprocessor
Commits
8584f9a6
Verified
Commit
8584f9a6
authored
6 months ago
by
Joschua "λ" Kesper
Browse files
Options
Downloads
Patches
Plain Diff
Read old.json from file rather than from URL
parent
bd24ba1e
Branches
Branches containing commit
No related tags found
1 merge request
!51
Fix title
Pipeline
#263172
passed
6 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/index.ts
+14
-12
14 additions, 12 deletions
src/index.ts
with
15 additions
and
13 deletions
README.md
+
1
−
1
View file @
8584f9a6
...
@@ -17,6 +17,6 @@ Install dependencies:
...
@@ -17,6 +17,6 @@ Install dependencies:
## Testing
## Testing
1.
Run
`pnpm build && node out.js test/test_transcripts test/out`
1.
Run
`pnpm build && node out.js test/test_transcripts test/out
-O test/test_old.json
`
-
If you only want to test a single file, you also use
`test/single_transcript`
as input
-
If you only want to test a single file, you also use
`test/single_transcript`
as input
2.
Open any file in test/out in your browser
2.
Open any file in test/out in your browser
This diff is collapsed.
Click to expand it.
src/index.ts
+
14
−
12
View file @
8584f9a6
...
@@ -12,6 +12,7 @@ async function main() {
...
@@ -12,6 +12,7 @@ async function main() {
)
)
.
argument
(
"
<outputDir>
"
,
"
path to output the rendered html to
"
)
.
argument
(
"
<outputDir>
"
,
"
path to output the rendered html to
"
)
.
option
(
"
-A, --output-ast
"
,
"
Also save the AST as a file
"
,
false
)
.
option
(
"
-A, --output-ast
"
,
"
Also save the AST as a file
"
,
false
)
.
option
(
"
-O, --old-json [path]
"
,
"
JSON file to take data about extra transcripts from
"
)
.
option
(
"
-B, --base-url [url]
"
,
"
Basic URL for the RSS feed
"
)
.
option
(
"
-B, --base-url [url]
"
,
"
Basic URL for the RSS feed
"
)
.
action
(
run
);
.
action
(
run
);
await
program
.
parseAsync
(
process
.
argv
);
await
program
.
parseAsync
(
process
.
argv
);
...
@@ -53,18 +54,19 @@ async function run(inputDir: string, outputDir: string, options: CliOptions) {
...
@@ -53,18 +54,19 @@ async function run(inputDir: string, outputDir: string, options: CliOptions) {
// (4) Generate index page
// (4) Generate index page
let
oldTranscripts
:
FinishedTranscriptMeta
[]
=
[];
let
oldTranscripts
:
FinishedTranscriptMeta
[]
=
[];
try
{
if
(
options
.
oldJson
)
{
// These are generated in the Sitzungen repo
try
{
const
res
=
await
fetch
(
"
https://fsr.oh14.de/protokolle/old.json
"
);
// These are generated in the Sitzungen repo
oldTranscripts
=
(
await
res
.
json
()).
map
(
t
=>
({
const
res
=
await
fs
.
readFile
(
options
.
oldJson
,
{
encoding
:
'
utf8
'
})
// Fallback for some options:
oldTranscripts
=
JSON
.
parse
(
res
).
map
(
t
=>
({
spec_version
:
-
1
,
// PDFs
// Fallback for some options:
no_link
:
false
,
spec_version
:
-
1
,
// PDFs
...
t
,
no_link
:
false
,
}));
...
t
,
console
.
log
(
oldTranscripts
);
}));
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
"
Failed to get old transcripts
"
,
e
);
console
.
error
(
"
Failed to get old transcripts
"
,
e
);
}
}
}
const
allTranscripts
=
[
const
allTranscripts
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment