How to disable MDX in Docusaurus - 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

Related

How to create uneditable / locked regions in templates in 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.

Apache Velocity "main template"?

I'm very new to Apache Velocity, and I'm having a little trouble figuring out the optimal way to structure my templates. In most of the guides I have seen the pages have been built like this:
#parse("header.vm")
<body>
...
</body>
#parse("footer.vm")
I have also seen someone come close to a "main" template with this approach:
<head>
...
</head>
<body>
#if($activeTab=="home")
#parse("home.vm")
#elseif($activeTab=="aboutus")
#parse("aboutus.vm")
...and so on.
</body>
Which seems a little silly, but I guess it works.
I've used Twirl a lot, so I might be spoiled, but I'd like to inject a template into another, essentially ending up with a main template like this:
<head>
...
</head>
<body>
$content
</body>
And then writing every other template as:
#parse(main){
TEMPLATE CONTENT
}
Is this possible in Velocity? If yes, is it bad practice, and if so why?
Thanks.
Velocity itself doesn't provide good support to layout template (the main template as you called). However they provide a tool called Velocity Layout Servlet (VLS).
To give you a heads up, some other templating solution like Rythm provides very nice template layout management via the template inheritance mechanism (demo). Disclaimer: I am the author of Rythm so I might have some bias here. However you can checkout this article created by a third party to understand the pros and cons of different template solutions.
You can use the $!bodyContent variable.
mainLayout.vm:
#macro(mainLayout)
<head>
...
</head>
<body>
$!bodyContent
</body>
#end
index.vm:
##mainLayout()
<h1>Index page</h1>
#end

Apache add Content of a Link to response

I want to know if it is possible to let apache substitue a link in the html I return to the client with the html of the site behind the link.
So instead of
<html>
<head>
</head>
<body>
Link
</body>
</html>
I want something like this:
<html>
<head>
</head>
<body>
// the html of the page behind the link
</body>
</html>
I can´t use javascript or php or anything, let´s assume I only have html.IFrames are as well no solution for my problem.
Just for everyone that comes to a similar situation, Ulrich Schwarz gave a good hint with SSIs, which is in this scenario the only way that could work. However, due to cancelling the project, I was not able to validate the usage of SSI for this scenario.
This can be little painful to do and might not be suitable for all cases but you can maintain a plaintext file for every html page you want to show source of and add a link to that file instead.
For eg: Instead of <a href='somefile.html'>Click</> do <a href='somefile.source'>Click</>
where somefile.source is the copy of the somefile.html. Add triple qoutes """ in the first and the last line of the file. I didn't try a lot of combinations but this works for fairly decent html codes.

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.

web agent can redirect to the top target?

I'm calling from an iframe an agent that should redirect the user to a given page on the whole page.
It's a lotus script agent that do his stuff and then redirect using a common:
Print "[http://www.server.com/db.nsf/simpleForm?OpenForm]"
How could I mention the TARGET (_top in my case) ?
thanks,
Since no better response had been given, I share my Javascript solution (comment welcome):
Print |<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
window.top.location.href = "/myDB.nsf/MyFullRedirectedPage?OpenForm&L=|+lang+....+ |";
// -->
</script>
</head>
<body "style=\"margin:0 ; background:transparent\"">
processing... please wait! N.B. this text will appear very short time.
</body>
</html>|
I put a background:transparent since I'm in a iframe.
I don't love this code almost flashing before the whole page is being refreshed.