Skip to content

Conversation

JJ-8
Copy link
Collaborator

@JJ-8 JJ-8 commented Sep 2, 2022

All tasks can now be bundled together to create one big document of tasks that can be submitted as a writeup for a CTF. This saves lots of time copying the tasks in a document one by one.

The user can choose to export all tasks or only the solved tasks.

Optionally, the user can supply a team name to add to the writeup since that is often required if you want to submit it to an organization.

The export is done client side using the APIs of Hedgedoc.

This functionality is especially useful for CTFs where you have to submit your writeup very quickly after the competition (for example the ECSC).

Example of an export:

![CTF logo](https://ctftime.org/media/events/balsn123.jpg)

Balsn CTF 2022
===

Sat, 03 Sep 2022 02:00:00 GMT - Mon, 05 Sep 2022 02:00:00 GMT
Team: Team name

| Task | Flag |
|---|---|
| First Task | FLAG{TEST} |
| Second Task | FLAG{ASDF} |


# First Task - Category

## Description

Description

----

Some writeup


# Second Task - Category

## Description

Second description

----

Some writeup

UI screenshots:

dialog

button

Feel free to change the layout of the export!

All tasks can now be bundled together to create one big document
of tasks that can be submitted as a writeup for a CTF.
This saves lots of time copying the tasks in a document one by one.

The user can choose to export all tasks or only the solved tasks.

Optionally, the user can supply a team name to add to the writeup since
that is often required if you want to submit it to an organization.

The export is done client side using the APIs of Hedgedoc.
@JJ-8 JJ-8 requested a review from XeR September 2, 2022 18:03
Copy link
Contributor

@XeR XeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice idea.
I hope people won't mistake this as an "export writeups" feature. I like reading quality writeups.

Are we sure Markdown is the best format for this feature ?
I think an archive would be better. Zip files are probably the best choice.
What do you think ?

@JJ-8
Copy link
Collaborator Author

JJ-8 commented Sep 5, 2022

Are we sure Markdown is the best format for this feature ?

At least I would like to keep the markdown option since then I am able to export all the tasks and import them in my personal note taking database, so the tasks are indexed and easily searchable for me.

I think an archive would be better. Zip files are probably the best choice.
What do you think ?

I think it is the best to give the user the choice for the export format. So a dropdown with the options "Markdown" and "Zip" would fit this idea. However, I would suggest to delay this extra feature in another PR since I don't have time to realize this myself.

Current exporter prints the date and the team name like this:
```
$start - $end\n
Team: $team
```

Markdown renderers will print those lines on the same line:
```
$start - $end Team: $team
```

The proper way to force a new line is to end the first line with two spaces.

> When you do want to insert a <br /> break tag using Markdown, you end a line
> with two or more spaces, then type return.

Source: https://daringfireball.net/projects/markdown/syntax#p
Copy link
Contributor

@XeR XeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty to push a commit to your branch.

If you agree with it, feel free to merge the PR. Otherwise, you can reset it, force push and merge 6b4c692.

@JJ-8
Copy link
Collaborator Author

JJ-8 commented Sep 7, 2022

Thanks for the fix! I did not know this behavior of Markdown.

@JJ-8 JJ-8 merged commit 9993ab3 into TFNS:main Sep 7, 2022
@JJ-8 JJ-8 deleted the 0-export-tasks branch September 7, 2022 12:50
JJ-8 added a commit that referenced this pull request Sep 7, 2022
JJ-8 added a commit that referenced this pull request Sep 7, 2022
JJ-8 added a commit to JJ-8/CTFNote that referenced this pull request Feb 14, 2023
This adds the possibility to use a zip archive as the export format.
It will add every task as a Markdown file to the zip archive and create an
overview file which contains the same introduction as the Markdown export.
The original single-markdown export is still possible and the default.

To create the zip archive, the dependency [JSZip](https://www.npmjs.com/package/jszip) is used.

This feature was also already suggested in TFNS#185 (review).
JJ-8 added a commit that referenced this pull request Feb 16, 2023
This adds the possibility to use a zip archive as the export format.
It will add every task as a Markdown file to the zip archive and create an
overview file which contains the same introduction as the Markdown export.
The original single-markdown export is still possible and the default.

To create the zip archive, the dependency [JSZip](https://www.npmjs.com/package/jszip) is used.

This feature was also already suggested in #185 (review).
lkempf pushed a commit to lkempf/CTFNote that referenced this pull request Nov 19, 2023
This adds the possibility to use a zip archive as the export format.
It will add every task as a Markdown file to the zip archive and create an
overview file which contains the same introduction as the Markdown export.
The original single-markdown export is still possible and the default.

To create the zip archive, the dependency [JSZip](https://www.npmjs.com/package/jszip) is used.

This feature was also already suggested in TFNS#185 (review).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants