EOF marker for embedding HTML source code in programming languages

Is there such a thing as there is in Perl in Arduino C to embed fully formatted and unescaped HTML in a C file? In perl there is a way, I haven't done Perl in a while, but when I was doing emailers I could embed my HTML into the Perl file using an opening statement and then write full blown formatted unescaped HTML in the Perl file right up to the point when I declared an EOF, at which point the Perl compiler stopped reading the text as a string literal. It was like a buffer within my Perl file.

I am sick of having to minify and escape HTML source code that I want to embed into my ESP, and I dont have the luxury of using an SD card for source file retrieval as my PCBs for the ESP are already designed. The ESP, a nodeMcu, plugs into a socket in my PCB, and I was stupid enough to rush and not use the analog pins and other pins for my relays (4) and use the standard MISO, MOSI, CS, pins for my SD card socket. I did include a header for I2C communications, but never thought I'd be using the SD card, or have taken the project this far.

Any help would be appreciated.

Thanks

use SPIFFS for static files

You can do this kind of thing. You can put whatever you want between the =====( and )===== markers, and they'll go into your string.

I've used it but I don't know if it's C++, or an Arduino-specific macro or what.

const char webpage[] PROGMEM = R"=====(
<HTML>
 <HEAD>
 <TITLE>Hello World</TITLE>
 </HEAD>
<BODY>
<p>Hello world</p>
</BODY>
</HTML>
)=====";

Never heard of that one before. Where'd you find that?

-jim lee

I was messing around with web servers on ESP8266 and it was in one of the tutorials I followed. I can't find that link but trying to find it just now I discovered this short discussion thread.

Now I know it's a fairly new C++ feature, called a "raw string literal".

New in C++11.
R"delimiter(
)delimiter"

The "delimiter" can be 0 to 16 repeats of any character except parentheses, backslash and spaces. Pick a delimiter such that ')delimiter' doesn't show up in the text.

But can you put parentheses in the string without the backslash ? cause this is what you want to do i guess.

Deva_Rishi:
But can you put parentheses in the string without the backslash ? cause this is what you want to do i guess.

you can have parenthesis - depends what's next to them.... you can't reproduce exactly your Row String Literal end delimiter... but as you can choose the delimiter your want, unless you don't think about it - it should be easy to get it right

the spec states that delimiter is a character sequence made of any source character but parentheses, backslash and spaces (can be empty, and at most 16 characters long)

So found it ! I was in another thread where the SPIFFS was relevant to the issue, and doing some research on the matter i found these 2 links which i think might actually be sort of what you are looking for, so i thought i had better look for this thread again (and found it somewhere on p16 or 17) and add it here as well.