I'd like to write my terms and conditions using a word processor, save it and easily embed the file in my Rails application. Nothing fancy, just have paragraphs, and bold (and regular) fonts. Which is a file format that can be easily used to display a formatted text with Rails? I don't want to have to deal with a lot of gems, dependencies, etc for some simple formatting.
Thanks.
I think you'll need to do normal html formatting, because all view files are .html.erb so I don't think you can copy your style/format from editors unless you have a html text editor.
I suggest that you should write it in a plain text and later add html tags for formatting, also by this method you don't have to deal with any gems or dependencies. You can also use css to make it better styled.
Related
I am learning how to make README.md files stylish and easy to read. I am also trying to learn good coding, GitHub, and repository structuring practices.
I found that I could style README.mds using HTML. However, I am a bit confused about how HTML interacts with .md files.
For example, does <h1>Project Title</h1> work the same as #Project Title in a README.md?
Additionally, is it considered bad practice to use HTML to format a README.md? I noticed a lot of my friends repositories do not use HTML.
Thank you for your time and assistance.
Both <h1></h1> and # seem to work the same in README.md. However, I am worried I am not following standard practice or am making my README.mds incompatible with other markdown features (or something like that).
I am so new to GitHub that I can't tell if I am doing something wrong by using HTML. Thanks!
Typically, yes, a top-level heading is equivalent to h1. Markdown is designed to be a shorthand for HTML and so it has a lot of correspondence. In addition, you can embed HTML in your Markdown file to do things that Markdown itself can't.
However, having said that, if you're writing Markdown, it's best to use the Markdown features wherever possible. Those will be more familiar to people and generally more flexible, substantially easier to read in plain text, and in some cases, such as READMEs and documents on GitHub, certain tags, as well as JavaScript and CSS, are restricted for security purposes. In addition, if you're converting Markdown to another format with a tool like pandoc, much of that HTML won't transfer.
Thus, you'll have more success if you think about Markdown as an independent document language you use to write text, where you may, from time to time, embed HTML to do very specific things, rather than writing a full Markdown-HTML hybrid. When you think about using Markdown as a document language primarily for text, and not a language that has support for formatting documents (e.g. alignments, colours, layout, etc.), then it becomes easier to write Markdown documents that work in a wide variety of contexts. Since your README is designed to basically communicate ideas using text, perhaps with a few images, that approach will help you write more typical Markdown.
I'm working on a document printout from MS PowerApps. Best method I have found thus far is to write it in HTML and but save as a .doc file so that it opens in word online. From there, the user can save as PDF. So far, this works surprisingly well and allows for a great deal of control over the output, but one limitation I have found is that word does not seem to recognize multiple classes on a single element. This is kind of a pain as I am using a lot of tables, so I have to either create a new class for every single cell cell format I need or use inline CSS instead. Not huge issue, but it makes for messy code and time consuming updates. Is there any way to achieve this?
Edit:
File here: https://wetransfer.com/downloads/29323f5c8060a374ed23e8ff2b6e9fd320210116015928/c991f4
It's designed to open in word online but it works in desktop as long as the view mode is set to print layout and not web layout.
Edit2: I should note that I did not figure out the headers all by myself, but worked off of some code provided by Georgi Nikolov found here
You can't write HTML or CSS Code into MS Word.
MS Word is Rich Text Editor
Rich Text: Rich Text Format (RTF) is a file format that allows the exchange of text files between different editors and it has its formatting so we can't use it to write HTML.
HTML Must be written in Plain Text Editor because Plain text contains no formatting, only line breaks and spacing. Therefore no text formatting (such as font sizes and colors, bolding or italics) can be used.
some examples for Plain TextEditors that you can use to write HTML and CSS are Notepad and Notepad++
I have to make a release notes document in word based on an xml export from Jira.
Some of the fields that we need in the release notes document are rich text enabled. In reality the output is html styled text.
To be able to mix the html text and the plain text from Jira, we opted to use the word html (save a word document as web page) as a template.
Then we use xslt to add the needed values from the xml export into the word html template.
This seems to be working quite ok, but we ran into a problem.
The release notes format in word has a lot of styles (some of them are custom build)
But in the document we get when opening the transformed file (thus technically HTML) we only get 2 styles: Normal and heading1
(I prepared 2 screenshots, but I can't post images yet)
My question now is:
Is there a way to add these styles to the word html part so these can still be used by our users to edit the document after it is generated.
I thought there had to be something I could add here to insert these styles. But I can't seem to figure out what.
there is a style part in the html, so that is what I primarily have been looking at.
any help would be appreciated. Even if you just point me to some documentation about word html, or to someone who might know this.
Kind regards
Peter
As an alternative approach, you could consider docx4j.XHTMLImport.
If your incoming XHTML contains #class values with the same names as styles in the target docx, then the converted content will use those styles.
I'll ask my question first, then give some background for those who are interested:
I would like to know if there is a command in html that will automatically generate a bibliography from a .bib file? This means that throughout the text, i would add something like <cite name="Jones2010">, and then at the bottom of the html (or css) file, I would write something like <makebib file="biblist.bib", format="APA">, and a bibliography would be generated using my .bib file, and formated according to the APA style. The functionality would be quite similar to footnotes, except that each footnote is populated according to some script that extracts the information from (essentially) an xml file and outputs the content in the desired format. It is not difficult to imagine somebody creating a tool to do just that, however, my google search skills have not enabled me to find such a tool. It is easy to find tools that convert bib files to html or xml, but that is not sufficient for my needs. I do not desire to publish my entire bib file online. Rather, for each document that I generate, I want several of the entries in the bib file to be included as footnotes. Any pointers will be greatly appreciated.
Now, the reason behind the question:
I have recently begun switching from writing all my manuscripts using latex to writing them using html/css. The advantages of this approach are fast: only 1 file for versioning (instead of .dvi, .ps, .aux, .blg, etc.), it is much smaller to share, other people can edit the html file and compile it much more easily, it is more configurable to my tastes, easier to read on screen, etc. The disadvantage for me, however, is that while I've been writing in latex for years, I've only just begin using html and css for scientific document creating. The main impetus for the switch was MathJaX, which enables me to to embed latex equations in my html files, and therefore, allows me to combine the advantages of latex with the advantages of css. I imagine that nearly all my colleagues will switch away from latex to this simpler format, assuming a few remaining issues get resolved, like ease of creating bibliographies.
Many thanks.
What you're asking isn't possible, unless when you specify html/css you really mean html/css/php or html/css/python or some other combination that includes an actual programming language, rather than just a markup language.
I understand your motivation, I'd love to switch to html instead of latex! However, I suspect an html-based solution would involve so much extra processing added on top to sort out bibliographies etc that the complexity would start approaching that of LaTeX by the time you got it all worked out.
I'd be pleased to be proven wrong on this!
I've done this, in the past, using XSLT and BibTeX. In outline, the steps are
Mark up your document using some convention or other: I used <span class='citation'>Smith99</span>
Write an XSLT script to transform that file into a .aux file with \citation commands in it
Use BibTeX along with a .bst file which spits out HTML rather than LaTeX
Use another XSLT script (or the same one, in a different mode) to pull the bibliography in
It's not quite as fiddly as it sounds, but you can look at how I did it on google code. In particular, see structure.xslt and plainhtml.bst.
If there's a more direct way, I'd be quite interested to hear about it.
Both answers so far are somewhat correct, although not quite what you were asking for. Part of the problem is that the question as it's phrased doesn't necessarily makes sense.
HTML is just markup; you need something to process the markup, be it python, php, ruby, etc.
And you probably want to write in XML (or XHTML), not HTML.
XSLT may work for you (once it's in XML), but remember, an XSLT document that defines a set of rules. You would get an XSLT engine to apply your XSLT rules against your XML document.
You can create an html bibliography from a .bib file using bibtex2html. This package takes a series of command line arguments and extracts the info from the BibTeX source and outputs a file with html markup.
As far as I know you cannot get it to read and parse the html document like the LaTeX \cite command but there are several ways to indicate the references you want. I find that the easiest way is to just maintain a text file of the BibTeX keys I use in my manuscript and then call this using the --citefile option. There is also a tool called bib2bib included that will take search commands.
It is a very flexible package and there are a lot of options so it works in a lot of situations. For example you can get it to omit the <html> headers from the output file so that you can directly paste into an existing html document.
The documentation is useful but make sure you look at the pdf documentation file and the man pages.
I have a website with Dutch text which I want to translate to English. Is there a fast way of doing this with keeping the HTML tags(<strong>,<span>) in tact. I know I can just copy the parsed TEXT into a translator but this will remove the formatting.
I also know that at the end I have to go trough the text manually to fix some minor spelling and grammar.
Online translators are good to turn foreign text into something that can be understood, but they are useless for producing quality translations. Even if you fix obvious problems at the end, you will get an amateurish word-by-word translation. If you want your visitors to take you seriously, you should translate from scratch.
If you want to preserve the HTML formatting at the same time as translating, you will have to work directly with the HTML source and update the text yourself without touching the formatting.
You may be able to use an XML editor like XmlSpy that will let you edit text nodes directly without touching the tagging, but this requires that the HTML is actually XHTML. You may still need to translate some attributes (such as title and alt attributes).
Is a virtual traslate a good option for you? Because if you paste google translato script into your page source, it will translate your text on the site, and the formating will stay there too. http://translate.google.com/translate_tools