Shlomi Fish avatar Shlomi Fish committed 721f27f

Convert another example to PerlBegin::TopicsExamples.

Comments (0)

Files changed (1)

src/topics/files-and-directories/index.html.wml

     });
 </script>
 
+<:
+    use PerlBegin::TopicsExamples;
+:>
+
 <:{
-    use PerlBegin::TopicsExamples;
-
     print PerlBegin::TopicsExamples->new(
         {
             title => "Copying a file",
     )->html_with_title();
 }:>
 
-<h3 id="overwrite_a_file">Overwriting a file with text.</h3>
-
-<div class="tabs">
-
-<ul>
-
-<li><a href="#overwrite_a_file_io_all">IO-All</a></li>
-
-<li><a href="#overwrite_a_file_core">Core Perl</a></li>
-
-</ul>
-
-<div id="overwrite_a_file_io_all">
-
-<perl_code>
+<:{
+    print PerlBegin::TopicsExamples->new(
+        {
+            title => "Overwriting a file with text",
+            id_base => "overwrite_a_file",
+            examples =>
+            [
+                {
+                    id => "io_all",
+                    label => "IO-All",
+                    code => <<'EOF',
 use IO::All;
 
 io->file("output.txt")->utf8->print("Hello World!\n");
-</perl_code>
+EOF
 
-</div>
-
-<div id="overwrite_a_file_core">
-
-<perl_code>
+                },
+                {
+                    id => "core",
+                    label => "Core Perl",
+                    code => <<'EOF',
 use autodie;
 
 open my $out, '>:encoding(utf8)', "output.txt";
 print {$out} "Hello World!\n";
 close($out);
-</perl_code>
-
-</div>
-
-</div>
+EOF
+                },
+            ],
+        }
+    )->html_with_title();
+}:>
 
 <h3 id="processing_lines_of_a_file">Processing the Lines of a File</h3>
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.