1

I am creating an internal web page using Sharepoint, which could be viewed by my team members only. I would like to include some python or JS code within the text of the web page. Does anyone know how to include code snippets so that the code stands out from the rest of the text (as it does on stackoverflow)?

Older versions of Sharepoint allowed Editing HTML source, but it does not look like that option exists anymore.

Any ideas?

1 Answer 1

2

We can use Script Editor web part to achieve this.

First Add a script editor web part into your page as below: enter image description here

Then click "EDIT SNIPPET" of this web part to add our HTML/JavaScript/PHP code within "xmp" tag.

For example as below:

enter image description here

Finally, save your changes and you will see what you want!

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.