Using ChatGPT

Custom Coding with ChatGPT

Overview
Creating Content
What is it Good for?
200
Create CMS Test Data
7:10
201
ChatGPT Useful Prompts
202
Custom Coding with ChatGPT
202
Creating SVG's w/ ChatGPT
203
Reporting & Business Intelligence
Extract Business Intelligence from Form Data
10:11
401
Midjourney
Creating Artwork with MidJourney
501
Integrating ChatGPT
Integrating ChatGPT with Webflow
600
No items found.
Published
July 6, 2023
Updated
in lightbox

So you need to write some code, and you kind of understand what you need to do, but you're not an experienced programmer.

What do you do?

You can use ChatGPT to help.

Example

This morning [ 8 Jul 2023 ], I did an experiment to see how good GPT4 is at building a simple ( but complete ) web tool.

The particular case I was looking for was a tool that could convert a chunk of pasted HTML or code into the specific partially-HTML-encoded format that is required by Finsweet's Code Highlight tool.

To syntax-highlight a code blog, Finsweet requires that you prepare a chunk of HTML that looks like this;










So that it is HTML encoded like this;

<div id="container">
<textarea id="input"></textarea>
<button id="convert-button" onclick="convert()">→</button>
<textarea id="output"></textarea>
<div id="result"></div>
</div>
<div id="output-copy-container">
<button id="copy-button" onclick="copyToClipboard()">Copy to Clipboard</button>
</div>

Look closely, and you'll note the addition of the <pre><code> wrapper elements and the HTML entity-encoding of < and & characters.

And, in case you're wondering, yes I just used the tool that I created with ChatGPT to generate the syntax highlighted code you're seeing above. Wild, eh?

Check out the Results

Here's the finished tool, available here on this site;

https://www.sygnal.com/tools/code-to-html

How I built it

To allow me to see and test the results of the code ChatGPT was creating, I used CodePen, and pasted the code accordingly.

You can see that CodePen here;

https://codepen.io/memetican/pen/KKrXeEL/9e82942bc281b72f0c4f12cc07e730b5

The process I used to build it involved progressively describing and changing what ChatGPT generated.

You can see my ChatGPT dialogue here;

https://chat.openai.com/share/276d7af7-750f-463e-bbcc-3d6c836542d4

Videos
No items found.
Table of Contents
Comments
Did we just make your life better?
Passion drives our long hours and late nights supporting the Webflow community. Click the button to show your love.