How to create uneditable / locked regions in templates in IntelliJ IDEA - intellij-idea

I have created a template file in my project which I want to apply to almost all pages in my website/project.
Ideally I would like there to be editable regions and uneditable/locked regions in the template, so that when I update the code in the template it should update all the uneditable regions in the pages that use this template.
For example, in Dreamweaver, you can do this:
<!doctype html>
<html lang="en">
<head>
<title>
<!-- TemplateBeginEditable name="title" -->
<!-- TemplateEndEditable -->
</title>
<head>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
The <title> and <head> areas remain editable for any page and won't be overwritten when a template file code changes. However if I was to remove the <html> tag then that would be removed for all pages using the template.
Can I achieve this in IntelliJ IDEA at all?

In IntelliJ IDEA consider using Structural Search and Replace - to find and replace some common code pattens or code templates. See Searching for XML and HTML tags, attributes, and their values for examples.

Related

How to disable MDX in Docusaurus

I have an existing site that uses Markdown and has HTML snippets but do not want them to be treated as MDX. How can I disable MDX entirely for now?
I don't believe that is possible to disable the MDX, but here's an alternative.
Put your HTML snippets inside a jfx code block. For example:
```jsx title="A Great Title (optional)"
<!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
```
This will produce

How to download this working jsfiddle?

The example given in jsfiddle.net/jjx86sqb/ is excellent and would like to download all the files.
Pls let me know how to download it.
I want to run the sample html file example locally
Simply copy and paste the HTML and jQuery sections of the fiddle to your own document.
Don't forget to include the four relevant external files:
https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css
https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js
https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.2/css/dataTables.alphabetSearch.css
https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.2/js/dataTables.alphabetSearch.min.js
You'll also need to reference jQuery itself (version 1.11.0 in the fiddle).
Version 1.11.0 can be found at:
https://code.jquery.com/jquery-1.11.0.min.js
Note that jQuery must be referenced before the four DataTables scripts.
Your <head> should look like this:
<head>
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.2/css/dataTables.alphabetSearch.css">
<script type="text/javascript" src="https://gyrocode.github.io/jquery-datatables-alphabetSearch/1.2.2/js/dataTables.alphabetSearch.min.js"></script>
</head>
The jQuery code itself must be placed between <script> tags after the five external files have been included.
Hope this helps! :)
it is possible. and easy.
add /embedded/ to the URL of the jsfiddle you want to download.
click on the result tab
right click on the screen and select view frame source (and not! view page source)
save the complete html you see to html file.
It is impossible and unnecessary feature to download the code. There are max 3 codes for you to copy viz. HTML, CSS and the script.
Just click on any of the code > Ctrl+A > and copy and paste it wherever you want.
Repeat the same steps for each code.

Grails Resources Plugin resource scope

I am struggling to understand the scope of resources defined with the Grails resources plugin.
I have created a small project (Grails 2.0.4) with a single domain item of Book and generated the associated Controller and Views.
I have then modified the main layout as follows:
<html>
<head>
<g:layoutTitle/>
<r:layoutResources/>
</head>
<body>
<g:layoutBody/>
<r:layoutResources/>
</body>
</html>
When I run the app I get no styling as expected.
I now add the following to the head list.gsp
<head>
<meta name="layout" content="main"/>
<r:require modules="jquery-mobile"/>
</head>
When I go to the list page now I correctly get the jquery-mobile styling as expected but when I go to the create page I also get jquery-mobile styling but was expecting no styling, as this page does not contain the tag.
It seems that the resources selected for one page are being used for all other pages. Is this expected behaviour?
Thanks,
Kim
Use Resources 1.2, it sounds like this might be an old bug.

MVC4 How to configure different layouts & CSS for areas

I have an MVC4 web app and have created 2 areas. I cannot see how to use different layouts for them. When I created the areas there was not a shared folder generated for them,
I have tried creating one in the area named BO and copying the _layout.cshtml file there, no luck. Copied the _viewstart.cshtml file there,
renamed the _layout.cshtml to and changed the layout call in the BO area's _viewstart.cshtml to
Layout = ~/Areas/BO/Shared/Views/_BOLayout.cshtml";
still no luck, neither the layout nor the css & JS files are loading when I navigate to the BO area home page.
Lots of stuff around on making areas use the root _layout.cshtml but I cannot find much on using different ones for each area. Any suggestions please?
PS. The above (Copied the _viewstart.cshtml file there) also breaks things; I get: Type 'ASP._Page_Areas_BO__ViewStart_cshtml' does not inherit from 'System.Web.WebPages.StartPage'. Error on navigating to the area.
The following structure should work for an Admin area for example:
~/Areas/Admin/Views/Shared/_AdminLayout.cshtml:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
#RenderBody()
</body>
</html>
~/Areas/Admin/Views/_ViewStart.cshtml:
#{
Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}
~/Areas/Admin/Views/Foo/Index.cshtml:
<h2>Index view of FooController in Admin area</h2>

landscape fixed layout epub 3 viewing only 1 page at a time starting from indesign file

I am creating an indesign cs6 epub3 fixed layout with landscape only mode, viewing only one page at a time.
I added the meta
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:orientation">landscape</meta>
<meta property="rendition:spread">none</meta>
and I also specified the width and height in css and each xhtml file with
<meta name="viewport" content="width=1024, height=768" />
I want the document to appear as one landscape page only, not as a two sides book. Does anyone know how to achieve that?
Ensure that the package element within the .opf file includes version="3.0" and prefix="rendition: http://www.idpf.org/vocab/rendition/#.
e.g.
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="3.0" prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks:http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/">
See Liz Castro's blog post on fixed layouts for more info.
http://www.pigsgourdsandwikis.com/2012/05/readium-displays-fixed-layout-epub-on.html