From 8a75f06657d9d920d1436027308a42ce0ddc3fdd Mon Sep 17 00:00:00 2001 From: Mithical Date: Wed, 4 Oct 2023 23:36:39 +0300 Subject: [PATCH 1/4] Create advanced-formatting.html --- db/seeds/posts/advanced-formatting.html | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 db/seeds/posts/advanced-formatting.html diff --git a/db/seeds/posts/advanced-formatting.html b/db/seeds/posts/advanced-formatting.html new file mode 100644 index 000000000..6cfc0525a --- /dev/null +++ b/db/seeds/posts/advanced-formatting.html @@ -0,0 +1,61 @@ +

Posts on Codidact, including questions, answers, articles, tag wikis, help pages, and user profiles, support the use of the following HTML tags:

+ +

These tags may have the following attributes:

+ +

Shorter text forms, such as comments, support the following HTML tags:

+ +

These tags may have the following attributes:

+ +
+

HTML tags that do not appear on this list will be stripped out and not displayed if they are included in posts or comments. The source code for supported tags in posts can be found in posts_helper.rb, and for comments in comments_helper.rb.

+
+

Much of the content of this page came from this answer by luap42.

From f370478456e850b6343df46b83718eb598829ae1 Mon Sep 17 00:00:00 2001 From: Mithical Date: Wed, 4 Oct 2023 23:40:51 +0300 Subject: [PATCH 2/4] add advanced formatting --- db/seeds/posts.yml | 73 ++++++++++------------------------------------ 1 file changed, 15 insertions(+), 58 deletions(-) diff --git a/db/seeds/posts.yml b/db/seeds/posts.yml index 893015027..e963516e5 100644 --- a/db/seeds/posts.yml +++ b/db/seeds/posts.yml @@ -6,36 +6,28 @@ help_category: Legal community_id: ~ -- post_type_id: <%= PolicyDoc.post_type_id %> - title: Privacy Policy - body_markdown: $FILE posts/privacy-policy.html - body: $FILE posts/privacy-policy.html - doc_slug: privacy-policy - help_category: Legal - community_id: ~ - - post_type_id: <%= PolicyDoc.post_type_id %> title: Code of Conduct body_markdown: $FILE posts/coc.html body: $FILE posts/coc.html doc_slug: code-of-conduct - help_category: About the Network + help_category: About Codidact community_id: ~ - post_type_id: <%= PolicyDoc.post_type_id %> - title: Network FAQ + title: Codidact FAQ body_markdown: $FILE posts/global_faq.html body: $FILE posts/global_faq.html - doc_slug: network-faq - help_category: About the Network + doc_slug: codidact-faq + help_category: About Codidact community_id: ~ - post_type_id: <%= PolicyDoc.post_type_id %> - title: Guidelines for promotional content in posts + title: Guidelines for promotional content in posts on Codidact sites body_markdown: $FILE posts/spam.html body: $FILE posts/spam.html doc_slug: spam - help_category: About the Network + help_category: About Codidact community_id: ~ - post_type_id: <%= HelpDoc.post_type_id %> @@ -52,6 +44,13 @@ doc_slug: formatting help_category: Site Information +- post_type_id: <%= HelpDoc.post_type_id %> + title: Advanced formatting help + body_markdown: $FILE posts/advanced-formatting.html + body: $FILE posts/advanced-formatting.html + doc_slug: advanced-formatting + help_category: Site Information + - post_type_id: <%= HelpDoc.post_type_id %> title: So you're a moderator now body_markdown: $FILE posts/moderator.html @@ -59,13 +58,6 @@ doc_slug: moderator help_category: $Moderator -- post_type_id: <%= HelpDoc.post_type_id %> - title: Guidance on warnings and suspensions - body_markdown: $FILE posts/warnings.html - body: $FILE posts/warnings.html - doc_slug: warnings - help_category: $Moderator - - post_type_id: <%= HelpDoc.post_type_id %> title: How to write good alt text body_markdown: $FILE posts/alt-text.html @@ -88,21 +80,14 @@ help_category: Guidance - post_type_id: <%= HelpDoc.post_type_id %> - title: Guidelines for referencing and quoting + title: Guidelines for referencing and quoting on Codidact sites body_markdown: $FILE posts/referencing.html body: $FILE posts/referencing.html doc_slug: referencing help_category: Guidance - post_type_id: <%= HelpDoc.post_type_id %> - title: Guidance on available licenses - body_markdown: $FILE posts/licenses.html - body: $FILE posts/licenses.html - doc_slug: licenses - help_category: Guidance - -- post_type_id: <%= HelpDoc.post_type_id %> - title: Search options + title: Codidact search options body_markdown: $FILE posts/search.html body: $FILE posts/search.html doc_slug: search @@ -114,31 +99,3 @@ body: $FILE posts/scoring.html doc_slug: scoring help_category: Site Information - -- post_type_id: <%= HelpDoc.post_type_id %> - title: About category access and write permissions - body_markdown: $FILE posts/category-permissions.html - body: $FILE posts/category-permissions.html - doc_slug: category-permissions - help_category: $Moderator - -- post_type_id: <%= HelpDoc.post_type_id %> - title: User Abilities - body_markdown: $FILE posts/abilities.html - body: $FILE posts/abilities.html - doc_slug: abilities - help_category: Site Information - -- post_type_id: <%= HelpDoc.post_type_id %> - title: Voting - body_markdown: $FILE posts/voting.html - body: $FILE posts/voting.html - doc_slug: voting - help_category: Guidance - -- post_type_id: <%= HelpDoc.post_type_id %> - title: Why are posts deleted? - body_markdown: $FILE posts/deleted.html - body: $FILE posts/deleted.html - doc_slug: deleted - help_category: Site Information From dbf4ad8dc48402563cec4cfad804714b9daf713c Mon Sep 17 00:00:00 2001 From: Mithical Date: Wed, 4 Oct 2023 23:43:08 +0300 Subject: [PATCH 3/4] Update posts.yml --- db/seeds/posts.yml | 80 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/db/seeds/posts.yml b/db/seeds/posts.yml index e963516e5..2cd8b67d2 100644 --- a/db/seeds/posts.yml +++ b/db/seeds/posts.yml @@ -6,28 +6,36 @@ help_category: Legal community_id: ~ +- post_type_id: <%= PolicyDoc.post_type_id %> + title: Privacy Policy + body_markdown: $FILE posts/privacy-policy.html + body: $FILE posts/privacy-policy.html + doc_slug: privacy-policy + help_category: Legal + community_id: ~ + - post_type_id: <%= PolicyDoc.post_type_id %> title: Code of Conduct body_markdown: $FILE posts/coc.html body: $FILE posts/coc.html doc_slug: code-of-conduct - help_category: About Codidact + help_category: About the Network community_id: ~ - post_type_id: <%= PolicyDoc.post_type_id %> - title: Codidact FAQ + title: Network FAQ body_markdown: $FILE posts/global_faq.html body: $FILE posts/global_faq.html - doc_slug: codidact-faq - help_category: About Codidact + doc_slug: network-faq + help_category: About the Network community_id: ~ - post_type_id: <%= PolicyDoc.post_type_id %> - title: Guidelines for promotional content in posts on Codidact sites + title: Guidelines for promotional content in posts body_markdown: $FILE posts/spam.html body: $FILE posts/spam.html doc_slug: spam - help_category: About Codidact + help_category: About the Network community_id: ~ - post_type_id: <%= HelpDoc.post_type_id %> @@ -44,13 +52,6 @@ doc_slug: formatting help_category: Site Information -- post_type_id: <%= HelpDoc.post_type_id %> - title: Advanced formatting help - body_markdown: $FILE posts/advanced-formatting.html - body: $FILE posts/advanced-formatting.html - doc_slug: advanced-formatting - help_category: Site Information - - post_type_id: <%= HelpDoc.post_type_id %> title: So you're a moderator now body_markdown: $FILE posts/moderator.html @@ -58,6 +59,13 @@ doc_slug: moderator help_category: $Moderator +- post_type_id: <%= HelpDoc.post_type_id %> + title: Guidance on warnings and suspensions + body_markdown: $FILE posts/warnings.html + body: $FILE posts/warnings.html + doc_slug: warnings + help_category: $Moderator + - post_type_id: <%= HelpDoc.post_type_id %> title: How to write good alt text body_markdown: $FILE posts/alt-text.html @@ -80,14 +88,21 @@ help_category: Guidance - post_type_id: <%= HelpDoc.post_type_id %> - title: Guidelines for referencing and quoting on Codidact sites + title: Guidelines for referencing and quoting body_markdown: $FILE posts/referencing.html body: $FILE posts/referencing.html doc_slug: referencing help_category: Guidance - post_type_id: <%= HelpDoc.post_type_id %> - title: Codidact search options + title: Guidance on available licenses + body_markdown: $FILE posts/licenses.html + body: $FILE posts/licenses.html + doc_slug: licenses + help_category: Guidance + +- post_type_id: <%= HelpDoc.post_type_id %> + title: Search options body_markdown: $FILE posts/search.html body: $FILE posts/search.html doc_slug: search @@ -99,3 +114,38 @@ body: $FILE posts/scoring.html doc_slug: scoring help_category: Site Information + +- post_type_id: <%= HelpDoc.post_type_id %> + title: About category access and write permissions + body_markdown: $FILE posts/category-permissions.html + body: $FILE posts/category-permissions.html + doc_slug: category-permissions + help_category: $Moderator + +- post_type_id: <%= HelpDoc.post_type_id %> + title: User Abilities + body_markdown: $FILE posts/abilities.html + body: $FILE posts/abilities.html + doc_slug: abilities + help_category: Site Information + +- post_type_id: <%= HelpDoc.post_type_id %> + title: Voting + body_markdown: $FILE posts/voting.html + body: $FILE posts/voting.html + doc_slug: voting + help_category: Guidance + +- post_type_id: <%= HelpDoc.post_type_id %> + title: Why are posts deleted? + body_markdown: $FILE posts/deleted.html + body: $FILE posts/deleted.html + doc_slug: deleted + help_category: Site Information + +- post_type_id: <%= HelpDoc.post_type_id %> + title: Advanced formatting help + body_markdown: $FILE posts/advanced-formatting.html + body: $FILE posts/advanced-formatting.html + doc_slug: advanced-formatting + help_category: Site Information From 325aedbd259d64b0875f3c367ee9da6a56062f88 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Sat, 21 Oct 2023 01:47:33 +0300 Subject: [PATCH 4/4] fix HTML indentation in the advanced-formatting seed --- db/seeds/posts/advanced-formatting.html | 125 ++++++++++++++---------- 1 file changed, 75 insertions(+), 50 deletions(-) diff --git a/db/seeds/posts/advanced-formatting.html b/db/seeds/posts/advanced-formatting.html index 6cfc0525a..6373aa426 100644 --- a/db/seeds/posts/advanced-formatting.html +++ b/db/seeds/posts/advanced-formatting.html @@ -1,61 +1,86 @@ -

Posts on Codidact, including questions, answers, articles, tag wikis, help pages, and user profiles, support the use of the following HTML tags:

+

Posts on Codidact, including questions, answers, articles, tag wikis, help pages, and user + profiles, support the use of the following HTML tags:

    -
  • a
  • -
  • p
  • -
  • span
  • -
  • b
  • -
  • i
  • -
  • em
  • -
  • s
  • -
  • strong
  • -
  • hr
  • -
  • h1, h2, h3, h4, h5, h6
  • -
  • blockquote
  • -
  • img
  • -
  • strike
  • -
  • del, ins
  • -
  • code
  • -
  • pre
  • -
  • br
  • -
  • ul, ol, li
  • -
  • sup, sub
  • -
  • section
  • -
  • details, summary
  • -
  • table, thead, tbody, tr, th, td
  • +
  • a
  • +
  • p
  • +
  • span
  • +
  • b
  • +
  • i
  • +
  • em
  • +
  • s
  • +
  • strong
  • +
  • hr
  • +
  • h1, h2, h3, h4, h5, + h6
  • +
  • blockquote
  • +
  • img
  • +
  • strike
  • +
  • del, ins
  • +
  • code
  • +
  • pre
  • +
  • br
  • +
  • ul, ol, li
  • +
  • sup, sub
  • +
  • section
  • +
  • details, summary
  • +
  • table, thead, tbody, tr, + th, td

These tags may have the following attributes:

    -
  • id
  • -
  • class
  • -
  • href
  • -
  • title
  • -
  • src
  • -
  • height
  • -
  • width
  • -
  • alt
  • -
  • dir
  • -
  • lang
  • -
  • start
  • -
  • rowspan
  • -
  • colspan
  • +
  • id
  • +
  • class
  • +
  • href
  • +
  • title
  • +
  • src
  • +
  • height
  • +
  • width
  • +
  • alt
  • +
  • dir
  • +
  • lang
  • +
  • start
  • +
  • rowspan
  • +
  • colspan

Shorter text forms, such as comments, support the following HTML tags:

    -
  • a
  • -
  • b
  • -
  • i
  • -
  • em
  • -
  • strong
  • -
  • strike
  • -
  • del
  • -
  • code
  • +
  • a
  • +
  • b
  • +
  • i
  • +
  • em
  • +
  • strong
  • +
  • strike
  • +
  • del
  • +
  • code

These tags may have the following attributes:

    -
  • href
  • -
  • title
  • +
  • href
  • +
  • title
-
-

HTML tags that do not appear on this list will be stripped out and not displayed if they are included in posts or comments. The source code for supported tags in posts can be found in posts_helper.rb, and for comments in comments_helper.rb.

-
-

Much of the content of this page came from this answer by luap42.

+
+

HTML tags that do not appear on this list will be stripped out and not displayed if they are + included in posts or comments. The source code for supported tags in posts can be found in + posts_helper.rb, and for comments in + comments_helper.rb.

+
+

Much of the content of this page came from + this answer by luap42.