You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2023/02/24 17:22:56 UTC

[netbeans-website] 01/01: testing the numbered list

This is an automated email from the ASF dual-hosted git repository.

skygo pushed a commit to branch orderedlisttest
in repository https://gitbox.apache.org/repos/asf/netbeans-website.git

commit d1ec23754f11aada509c953a8c1043c751256cc3
Author: Eric Barboni <sk...@apache.org>
AuthorDate: Fri Feb 24 18:22:50 2023 +0100

    testing the numbered list
    
    sorry @mbien  this PR is not for merge
    it's to try to help for #641
    
    note the usage of + to continue list between block removal (I use the . instead of number but that's me :D)
---
 .../src/content/tutorials/nbm-filetemplates.adoc   | 111 ++++++---------------
 1 file changed, 33 insertions(+), 78 deletions(-)

diff --git a/netbeans.apache.org/src/content/tutorials/nbm-filetemplates.adoc b/netbeans.apache.org/src/content/tutorials/nbm-filetemplates.adoc
index d52437703..d9b3f6494 100644
--- a/netbeans.apache.org/src/content/tutorials/nbm-filetemplates.adoc
+++ b/netbeans.apache.org/src/content/tutorials/nbm-filetemplates.adoc
@@ -79,14 +79,9 @@ The benefit of using FreeMarker can be seen in the template above, that is, you
 We begin by going through the New Module Project wizard, which will create a source structure, with all the minimum requirements, for our new module.
 
 
-[start=1]
-1. Choose File > New Project (Ctrl+Shift+N). Under Categories, select NetBeans Modules. Under Projects, select Module. Click Next.
-
-[start=2]
-1. In the Name and Location panel, type  ``AdditionalFileTemplates``  in the Project Name field. Change the Project Location to any directory on your computer. Click Next.
-
-[start=3]
-1. In the Basic Module Configuration panel, type  ``org.myorg.additionalfiletemplates``  in Code Name Base. Click Finish.
+. Choose File > New Project (Ctrl+Shift+N). Under Categories, select NetBeans Modules. Under Projects, select Module. Click Next.
+. In the Name and Location panel, type  ``AdditionalFileTemplates``  in the Project Name field. Change the Project Location to any directory on your computer. Click Next.
+. In the Basic Module Configuration panel, type  ``org.myorg.additionalfiletemplates``  in Code Name Base. Click Finish.
 
 The IDE creates the  ``AdditionalFileTemplates``  project. The project contains all of your sources and project metadata, such as the project's Ant build script. The project opens in the IDE. You can view its logical structure in the Projects window (Ctrl-1) and its file structure in the Files window (Ctrl-2).
 
@@ -100,15 +95,9 @@ A file template consists of a template file, an HTML description file, and an ic
 
 The template file defines the content that the template will generate for the user.
 
-
-[start=1]
-1. Right-click the  ``AdditionalFileTemplates``  node and choose New > Other. In the New File wizard, under Categories, choose Other and under File Types, choose HTML. Click Next.
-
-[start=2]
-1. 
-Type  ``HTML``  in File Name. Click Browse and browse to  ``src/org/myorg/additionalfiletemplates`` . Click Select Folder. Click Finish. A new HTML file, named  ``HTML.html`` , opens in the Source Editor, containing the standard HTML file's content shown below:
-
-
+. Right-click the  ``AdditionalFileTemplates``  node and choose New > Other. In the New File wizard, under Categories, choose Other and under File Types, choose HTML. Click Next.
+. Type  ``HTML``  in File Name. Click Browse and browse to  ``src/org/myorg/additionalfiletemplates`` . Click Select Folder. Click Finish. A new HTML file, named  ``HTML.html`` , opens in the Source Editor, containing the standard HTML file's content shown below:
++
 [source,html]
 ----
 
@@ -123,10 +112,7 @@ Type  ``HTML``  in File Name. Click Browse and browse to  ``src/org/myorg/additi
   </body>
 </html>
 ----
-
-
-[start=3]
-1. Change the HTML file according to your needs. You can add the following predefined variables, if needed:
+. Change the HTML file according to your needs. You can add the following predefined variables, if needed:
 * ${date} inserts the current date, in this format: Feb 16, 2008
 * ${encoding} inserts the default encoding, such as: UTF-8
 * ${name} inserts the name of the file.
@@ -224,14 +210,9 @@ The icon accompanies the file template in the New File wizard. It identifies it
 Once you have defined the file template, the description file, and the icon, you register them in the NetBeans virtual filesystem. The  ``layer.xml``  file is made for this purpose. The file is automatically created and populated via the @TemplateRegistration annotation used in the steps below.
 
 
-[start=1]
-1. Right-click the module in the Projects window, choose Properties, and use the Libraries tab to add dependencies on Datasystems API and Utilities API.
-
-[start=2]
-1. 
-Right-click the  ``org.myorg.additionalfiletemplates``  node and choose New > Other. Under Categories, choose Java. Under File Types, choose Java Package Info. Click Next. Click Finish. A Java class named  ``package-info.java``  is created. Redefine its content as follows:
-
-
+. Right-click the module in the Projects window, choose Properties, and use the Libraries tab to add dependencies on Datasystems API and Utilities API.
+. Right-click the  ``org.myorg.additionalfiletemplates``  node and choose New > Other. Under Categories, choose Java. Under File Types, choose Java Package Info. Click Next. Click Finish. A Java class named  ``package-info.java``  is created. Redefine its content as follows:
++
 [source,java]
 ----
 
@@ -249,10 +230,7 @@ import org.netbeans.api.templates.TemplateRegistration;
 import org.openide.util.NbBundle.Messages;
                     
 ----
-
-
-[start=3]
-1. Make sure that the structure of the module is as follows:
+. Make sure that the structure of the module is as follows:
 
 
 image::images/filetemplates_71_module-structure.png[]
@@ -262,23 +240,12 @@ image::images/filetemplates_71_module-structure.png[]
 
 The IDE uses an Ant build script to build and install your module. The build script is created for you when you create the module project.
 
-
-[start=1]
-1. In the Projects window, right-click the project and choose Run. The module is built and installed in a new instance of the development IDE.
-
-[start=2]
-1. Choose File > New Project (Ctrl-Shift-N) and create a new project.
-
-[start=3]
-1. 
-Right-click the project and choose New > Other. The New File dialog opens and displays the new file template. It should look something like this, although your icon will probably be different:
-
-
+. In the Projects window, right-click the project and choose Run. The module is built and installed in a new instance of the development IDE.
+. Choose File > New Project (Ctrl-Shift-N) and create a new project.
+. Right-click the project and choose New > Other. The New File dialog opens and displays the new file template. It should look something like this, although your icon will probably be different:
++
 image::images/filetemplates_71_new-file.png[]
-
-
-[start=4]
-1. Select the new file template and complete the wizard. When you click Finish, the Source Editor displays the newly created template.
+. Select the new file template and complete the wizard. When you click Finish, the Source Editor displays the newly created template.
 
 
 == Providing Additional Variables
@@ -317,16 +284,11 @@ One point that has not been discussed yet relates to the FreeMarker #assign dire
 To make sense of this, take the following steps:
 
 
-[start=1]
-1. Go to the Tools menu. Choose Templates. Open the Java | Java Class template in the editor:
-
-
+. Go to the Tools menu. Choose Templates. Open the Java | Java Class template in the editor:
++
 image::http://blogs.oracle.com/geertjan/resource/freemarker-in-nb-2.png[]
-
-
-[start=2]
-1. The template above, and the ramifications of defining it in FreeMarker, have been discussed above. However, let's look specifically at the first four lines:
-
+. The template above, and the ramifications of defining it in FreeMarker, have been discussed above. However, let's look specifically at the first four lines:
++
 [source,java]
 ----
 
@@ -335,58 +297,51 @@ image::http://blogs.oracle.com/geertjan/resource/freemarker-in-nb-2.png[]
 <#assign licenseLast = " */">
 <#include "../Licenses/license-${project.license}.txt">
 ----
-
++
 These four lines have to do with _licensing_. The last line determines the license that will be used, per project. The first three determine the characters in front of and behind each line in the license. Above are the four lines for Java source files. Here is the same set of definitions that you will find at the start of the Properties file template:
-
-
++
 [source,java]
 ----
 
 <#assign licensePrefix = "# ">
 <#include "../Licenses/license-${project.license}.txt">
 ----
-
++
 The first line tells us that each line in the license will be prefixed with a "# ", instead of with a "*", which is the prefix for Java source files (with "/*" for the first line and " */" for the last line). To verify this, create a Java source file and then create a Properties file. You will see a license in both cases. However, the characters prefixing and postfixing each line is different, because of the above definitions.
-
-
-[start=3]
-1. Next, let's look at the license itself. Notice this line in the templates above:
-
+. Next, let's look at the license itself. Notice this line in the templates above:
++
 [source,java]
 ----
 
 <#include "../Licenses/license-${project.license}.txt">
 ----
-
++
 In particular, notice this part:
-
-
++
 [source,java]
 ----
 
 ${project.license}
 ----
-
++
 Put that, as a key, in your application's  ``nbproject/project.properties``  file. Now add a value. For example:
-
-
++
 [source,java]
 ----
 
 project.license=apache
 ----
-
++
 Now look in the Template Manager again, in the Licenses folder. You see some templates there. Create a new one called " ``license-apache.txt`` ". For now, you can just copy an existing one and paste it in the same category in the Template Manager. Then, next time that you create a file that is defined by a FreeMarker template that includes this line:
-
-
++
 [source,java]
 ----
 
 <#include "../Licenses/license-${project.license}.txt">
 ----
-
++
 ...you will have the specified license embedded within the newly created file.
-
++
 In summary, since NetBeans IDE 6.0, you are able to let the user define, per project, the license that each of its files should display. Plus, imagine if the user needs to create a new project with a different license. Assuming the user has a set of licenses defined in the Template Manager, using a new license is as simple as adding that one key/value pair to the  ``nbproject/project.properties``  file. That was not possible before but, thanks to FreeMarker support, is possible now. For  [...]
 
 xref:../community/mailing-lists.adoc[Send Us Your Feedback]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists