Skip to content

Commit

Permalink
DOC-2598: Document Converters Cleanup (#3560)
Browse files Browse the repository at this point in the history
* DOC2598: Clean up document converters and fix broken links

* DOC-2598: TINY-11459 Improve the context form placeholder sample code

* Revert "DOC-2598: TINY-11459 Improve the context form placeholder sample code"

This reverts commit d136fa2.
  • Loading branch information
FarzadHayat authored Dec 12, 2024
1 parent 26d4a6e commit e738181
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 86 deletions.
12 changes: 6 additions & 6 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -314,20 +314,20 @@
*** xref:exportpdf.adoc[Export to PDF]
**** xref:html-to-pdf-converter-api.adoc[HTML to PDF Converter API]
**** JWT Authentication
***** xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[NodeJS]
***** xref:export-to-pdf-with-jwt-authentication-with-php.adoc[PHP]
***** xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Node.js]
***** xref:export-to-pdf-with-jwt-authentication-php.adoc[PHP]
*** xref:exportword.adoc[Export to Word]
**** xref:html-to-docx-converter-api.adoc[HTML to DOCX Converter API]
**** JWT Authentication
***** xref:export-to-word-with-jwt-authentication-nodejs.adoc[NodeJS]
***** xref:export-to-word-with-jwt-authentication-with-php.adoc[PHP]
***** xref:export-to-word-with-jwt-authentication-nodejs.adoc[Node.js]
***** xref:export-to-word-with-jwt-authentication-php.adoc[PHP]
*** xref:footnotes.adoc[Footnotes]
*** xref:formatpainter.adoc[Format Painter]
*** xref:importword.adoc[Import from Word]
**** xref:docx-to-html-converter-api.adoc[DOCX to HTML Converter API]
**** JWT Authentication
***** xref:importword-with-jwt-authentication-nodejs.adoc[NodeJS]
***** xref:import-word-with-jwt-authentication-with-php.adoc[PHP]
***** xref:import-from-word-with-jwt-authentication-nodejs.adoc[Node.js]
***** xref:import-from-word-with-jwt-authentication-php.adoc[PHP]
*** xref:editimage.adoc[Image Editing]
*** xref:uploadcare.adoc[Image Optimizer Powered by Uploadcare]
*** xref:inline-css.adoc[Inline CSS]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
= {pluginname} with JWT authentication (Node.js) Guide
:navtitle: JWT Authentication setup for Export to PDF
:description: Guide on how to setup JWT Authentication for exporting pdf files with Export to PDF
:keywords: jwt, authentication, exportpdf, pdf, node.js
:pluginname: Export to PDF
:plugincode: exportpdf
:pluginname: Export to PDF
:navtitle: JWT Authentication setup for {pluginname}
:description: Guide on how to setup JWT Authentication for exporting pdf files with {pluginname}
:keywords: jwt, authentication, exportpdf, pdf, node.js


include::partial$auth/document-converters/intro-and-prerequisites.adoc[]
include::partial$auth/document-converters/nodejs/intro-and-prerequisites.adoc[]

include::partial$auth/document-converters/initial-project-setup.adoc[]
include::partial$auth/document-converters/nodejs/initial-project-setup.adoc[]

== Setup

include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
=== Generate a Public/Private Key Pair

. In the root directory, copy and paste the server setup code into the `jwt.js` file (refer to the *Configuring the Node.js Server for JWT Token Generation* section).
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2]

include::partial$auth/document-converters/server-setup-jwt.adoc[]
include::partial$auth/document-converters/nodejs/server-setup-jwt.adoc[]

=== Web Page (public/index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
<!DOCTYPE html>
<html>
<head>
<title>TinyMCE with PDF Export</title>
<title>TinyMCE with Export to PDF</title>
<script
src="https://cdn.tiny.cloud/1/YOUR-API-KEY/tinymce/7/tinymce.min.js"
referrerpolicy="origin">
Expand Down Expand Up @@ -62,4 +64,4 @@ include::partial$auth/document-converters/server-setup-jwt.adoc[]
</html>
----

include::partial$auth/document-converters/configuration-steps.adoc[]
include::partial$auth/document-converters/nodejs/configuration-steps.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include::partial$auth/document-converters/php/server-setup-php.adoc[]

=== Web Page Setup (index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code:
Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
= {pluginname} with JWT authentication (Node.js) Guide
:navtitle: JWT Authentication setup for Export to Word
:description: Guide on how to setup JWT Authentication for exporting docx files with Export to Word
:keywords: jwt, authentication, exportword, node.js
:pluginname: Export to Word
:plugincode: exportword
:pluginname: Export to Word
:navtitle: JWT Authentication setup for {pluginname}
:description: Guide on how to setup JWT Authentication for exporting docx (Microsoft Word) files with {pluginname}
:keywords: jwt, authentication, exportword, node.js


include::partial$auth/document-converters/intro-and-prerequisites.adoc[]
include::partial$auth/document-converters/nodejs/intro-and-prerequisites.adoc[]

include::partial$auth/document-converters/initial-project-setup.adoc[]
include::partial$auth/document-converters/nodejs/initial-project-setup.adoc[]

== Setup

include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
=== Generate a Public/Private Key Pair

. In the root directory, copy and paste the server setup code into the `jwt.js` file (refer to the *Configuring the Node.js Server for JWT Token Generation* section).
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2]

include::partial$auth/document-converters/server-setup-jwt.adoc[]
include::partial$auth/document-converters/nodejs/server-setup-jwt.adoc[]

=== Web Page (public/index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
<!DOCTYPE html>
Expand Down Expand Up @@ -60,4 +62,4 @@ include::partial$auth/document-converters/server-setup-jwt.adoc[]
</html>
----

include::partial$auth/document-converters/configuration-steps.adoc[]
include::partial$auth/document-converters/nodejs/configuration-steps.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include::partial$auth/document-converters/php/server-setup-php.adoc[]

=== Web Page Setup (index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code:
Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
Expand Down
18 changes: 9 additions & 9 deletions modules/ROOT/pages/exportpdf.adoc
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
= {pluginname} plugin
:navtitle: Export to PDF
:description: The Export to PDF feature provides the ability to generate a PDF file directly from the editor.
:description_short: Generate a PDF file directly from the editor.
:keywords: plugin, exportpdf, export to pdf
:pluginname: Export to PDF
:plugincode: exportpdf
:pluginname: Export to PDF
:navtitle: {pluginname}
:description: The {pluginname} feature provides the ability to generate a PDF file directly from the editor.
:description_short: Generate a PDF file directly from the editor.
:keywords: plugin, {plugincode}, {pluginname}
:plugincategory: premium


include::partial$misc/admon-export-pdf-paid-addon-pricing.adoc[]

include::partial$misc/admon-requires-7.0v.adoc[]

The {pluginname} feature collects the HTML generated with the `tinymce.editor.getContent()` method and combines it with the default editor content styles along with the styles provided in the plugin configuration. The combined content and styles are then processed by the included server-side converter service, which can be either self-hosted or cloud-based. Following this processing, a PDF file is generated, which is subsequently returned to the users browser, enabling them to save it onto their disk or drive.
The {pluginname} feature collects the HTML generated with the `tinymce.editor.getContent()` method and combines it with the default editor content styles along with the styles provided in the plugin configuration. The combined content and styles are then processed by the included server-side converter service, which can be either self-hosted or cloud-based. Following this processing, a PDF file is generated, which is subsequently returned to the user's browser, enabling them to save it onto their disk or drive.

== Interactive example

Expand All @@ -36,8 +36,8 @@ tinymce.init({
[IMPORTANT]
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:

* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Export to PDF with JWT authentication (Nodejs)].
* xref:export-to-pdf-with-jwt-authentication-php.adoc[Export to PDF with JWT authentication (PHP)].
* xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
* xref:export-to-pdf-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]

== Basic setup using the self-hosted service

Expand Down Expand Up @@ -84,4 +84,4 @@ include::partial$commands/{plugincode}-cmds.adoc[]

== API Reference

> Explore the comprehensive API documentation for the {pluginname} Premium plugin at https://exportpdf.api.tiny.cloud/docs[Export to PDF.^]
> Explore the comprehensive API documentation for the {pluginname} Premium plugin at https://exportpdf.api.tiny.cloud/docs[{pluginname} API Reference Documentation.^]
18 changes: 9 additions & 9 deletions modules/ROOT/pages/exportword.adoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
= {pluginname} plugin
:navtitle: exportword
:description: The export to Word feature lets you generate a .docx file directly from the editor.
:description_short: Generate a .docx file directly from the editor.
:keywords: plugin, exportword.
:pluginname: Export to Word
:plugincode: exportword
:pluginname: Export to Word
:navtitle: {pluginname}
:description: The {pluginname} feature lets you generate a .docx (Microsoft Word document) file directly from the editor.
:description_short: Generate a .docx file directly from the editor.
:keywords: plugin, {plugincode}, {pluginname}
:plugincategory: premium

include::partial$misc/admon-export-word-paid-addon-pricing.adoc[]

include::partial$misc/admon-requires-7.0v.adoc[]

The export to Microsoft Word feature collects the HTML generated with the `tinymce.editor.getContent()` method and combines it with the default editor content styles along with the styles provided in the plugin configuration. The combined content and styles are then processed by the included server-side converter service, which can be either self-hosted or cloud-based. Following this processing, a Word file is generated, which is subsequently returned to the users browser, enabling them to save it in the Word format onto their disk or drive.
The export to Microsoft Word feature collects the HTML generated with the `tinymce.editor.getContent()` method and combines it with the default editor content styles along with the styles provided in the plugin configuration. The combined content and styles are then processed by the included server-side converter service, which can be either self-hosted or cloud-based. Following this processing, a Word file is generated, which is subsequently returned to the user's browser, enabling them to save it in the Word format onto their disk or drive.

== Interactive example

Expand Down Expand Up @@ -42,8 +42,8 @@ tinymce.init({
[IMPORTANT]
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:

* xref:export-to-word-with-jwt-authentication-nodejs.adoc[Export to Word with JWT authentication].
* xref:export-to-word-with-jwt-authentication-php.adoc[Export to Word with JWT authentication].
* xref:export-to-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
* xref:export-to-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]

== Basic setup using the self-hosted service

Expand Down Expand Up @@ -85,4 +85,4 @@ include::partial$commands/exportword-cmds.adoc[][leveloffset=+1]

== API Reference

> Explore the comprehensive API documentation for the {pluginname} Premium plugin at link:https://exportdocx.api.tiny.cloud/v2/convert/docs#section/Export-to-Word[Export to Word.^]
> Explore the comprehensive API documentation for the {pluginname} Premium plugin at link:https://exportdocx.api.tiny.cloud/v2/convert/docs#section/Export-to-Word[{pluginname} API Reference Documentation.^]
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
= {pluginname} with JWT authentication (Node.js) Guide
:navtitle: JWT Authentication setup for Import from Word
:description: Guide on how to setup JWT Authentication for importing docx (MS Word) files with Import from Word
:keywords: jwt, authentication, importword, node.js
:pluginname: Import from Word
:plugincode: importword
:pluginname: Import from Word
:navtitle: JWT Authentication setup for {pluginname}
:description: Guide on how to setup JWT Authentication for importing docx (Microsoft Word) files with {pluginname}
:keywords: jwt, authentication, importword, node.js


include::partial$auth/document-converters/intro-and-prerequisites.adoc[]
include::partial$auth/document-converters/nodejs/intro-and-prerequisites.adoc[]

include::partial$auth/document-converters/initial-project-setup.adoc[]
include::partial$auth/document-converters/nodejs/initial-project-setup.adoc[]

== Setup

include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
=== Generate a Public/Private Key Pair

. In the root directory, copy and paste the server setup code into the `jwt.js` file (refer to the *Server Setup (jwt.js)* section).
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2]

include::partial$auth/document-converters/server-setup-jwt.adoc[]
include::partial$auth/document-converters/nodejs/server-setup-jwt.adoc[]

=== Web Page (public/index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
<!DOCTYPE html>
Expand Down Expand Up @@ -62,4 +64,4 @@ include::partial$auth/document-converters/server-setup-jwt.adoc[]
</html>
----

include::partial$auth/document-converters/configuration-steps.adoc[]
include::partial$auth/document-converters/nodejs/configuration-steps.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include::partial$auth/document-converters/php/server-setup-php.adoc[]

=== Web Page Setup (index.html)

Inside the `public` folder where you created the `index.html` file add the HTML setup code:
Inside the `public` folder where you created the `index.html` file add the HTML setup code.

[source,html]
----
Expand Down
16 changes: 8 additions & 8 deletions modules/ROOT/pages/importword.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

= {pluginname} plugin
:navtitle: Import from Word
:description: Provides a way to import .docx (Word documents) or .dotx (Word templates) files into the editor.
:description_short: Import .docx or .dotx files into the editor.
:keywords: plugin, importword, import from word
:pluginname: Import from Word
:plugincode: importword
:pluginname: Import from Word
:navtitle: {pluginname}
:description: Provides a way to import .docx (Microsoft Word documents) or .dotx (Microsoft Word templates) files into the editor.
:description_short: Import .docx or .dotx files into the editor.
:keywords: plugin, {plugincode}, {pluginname}
:plugincategory: premium

include::partial$misc/admon-import-word-paid-addon-pricing.adoc[]
Expand Down Expand Up @@ -37,8 +37,8 @@ tinymce.init({
[IMPORTANT]
When using the {pluginname} plugin with the {companyname} Cloud service, JWT authentication is required to use the service. For more information on how to set up JWT authentication with {pluginname}, see examples:

* xref:import-to-word-with-jwt-authentication-nodejs.adoc[Import to Word with JWT authentication].
* xref:import-to-word-with-jwt-authentication-php.adoc[Import to Word with JWT authentication].
* xref:import-from-word-with-jwt-authentication-nodejs.adoc[{pluginname} with JWT authentication (Node.js)]
* xref:import-from-word-with-jwt-authentication-php.adoc[{pluginname} with JWT authentication (PHP)]

== Basic setup using the self-hosted service

Expand Down Expand Up @@ -83,4 +83,4 @@ include::partial$commands/importword-cmds.adoc[]

== API Reference

> Explore the comprehensive API documentation for the {pluginname} Premium plugin at link:https://importdocx.api.tiny.cloud/v2/convert/docs#section/Import-from-Word[Import from Word.^]
> Explore the comprehensive API documentation for the {pluginname} Premium plugin at link:https://importdocx.api.tiny.cloud/v2/convert/docs#section/Import-from-Word[{pluginname} API Reference Documentation.^]
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@ Your project should look like this:
index.html (TinyMCE webpage)
jwt.js (Server code)
package.json (Project configuration)
----

. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Web Page (public/index.html)* section).
----
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This guide provides a comprehensive walkthrough for integrating {pluginname} wit

Before diving into the technical details, here's what you'll achieve with this guide:

* A working {productname} editor running {pluginname} plugin.
* A secure authentication system using JWT token.
* A simple Node.js server to handle the authentication.
* A working {productname} editor running the {pluginname} plugin
* A secure authentication system using JWT tokens
* A simple Node.js server to handle the authentication

[TIP]
====
Expand All @@ -21,7 +21,7 @@ This guide is designed for developers new to JWT authentication and {productname

Before starting, ensure you have:

* Node.js installed on your computer
* Node.js installed on your computer (to check, run `node -v` in your terminal)
* A {productname} API key (get one from link:https://www.tiny.cloud/signup[TinyMCE's website])
* Basic familiarity with the command line

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== Server Setup (jwt.js)

In the root directory, copy and paste the server setup code into the `jwt.js` file.

[source,javascript]
----
const express = require('express'); // Sets up the web server.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== Configuration Steps
== Configuration Steps

==== 1. Add Your API Key
=== Add Your API Key

* Replace `YOUR-API-KEY` in both files with your actual {productname} API key
* The API key should be the same in both the HTML script source and the JWT payload

==== 2. Add Your Private Key
=== Add Your Private Key

* Replace the private key placeholder in `jwt.php` with your actual private key
* Make sure it's in `PKCS8` format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

This guide provides a comprehensive walkthrough for integrating {pluginname} with {productname}, including {pluginname} functionality, by using a PHP server for JWT token generation. It covers project setup, server configuration, and {productname} customization.

== What You'll Build
=== What You'll Build

Before diving into the technical details, here's what you'll achieve with this guide:

* A working {productname} editor running {pluginname} plugin.
* A working {productname} editor running the {pluginname} plugin
* A secure authentication system using JWT tokens
* A simple PHP server to handle the authentication

Expand Down
Loading

0 comments on commit e738181

Please sign in to comment.