3 Replies
      Latest reply on Nov 13, 2019 3:22 PM by MCStoufer_veeva
      InstantInteractive Level 1 Level 1 (0 points)

        In Xcode 11.1, I created a 'README.md' markdown file, but it always renders as its raw text (yet font size changes depending on header level).  For example, in Xcode's editor I see:


        # AppName
        ## Version


        Where the first line is in a larger font size than the lines 3 and 4.


        Anyhow, if I open up a project from Apple (e.g. BuildingCustomViewsInSwiftUI), it's README renders correctly.


        If I paste my project's contents into Apple's sample project README, it then renders a-ok.   The reverse though (taking the contents from Apple's sample and pasting into my project; even dragging in the original project) won't render it (I then see all the markup symbols such as #.


        I've checked every possible setting between the two projects and cannot figure out why this is happening.  The type of file (markdown), encoding, etc. are identical.


        However, one item I have noticed is that in Apple's sample project, when I view the README.md file, the Editor | Minimap menu choice is disabled and unchecked.  Whereas in my project, the menu choice is enabled.  Toggling that on/off though has no effect in my project.


        Thus, there must be some reason why Apple's sample has the Minimap option disabled.  And my guess is this is the reason why Apple's sample in then rendering the markdown file correctliy in the editor.


        Anyone know how to fix this?


        Note: I also viewed the contents of the various files under the .xcodeproj package and couldn't find anything useful (i.e.. I was hoping to find some settings difference regarding the readme file, but couldn't find any).

        • Re: Readme markdown not rendering in Xcode
          callenordangard Level 1 Level 1 (0 points)

          Seems as if the command Editor > Show Rendered Markup is missing from the menus in Xcode 11. I believe that was the way to switch between raw and renderd markup in earlier verisions.


          Curiously there is still the possibility to set a key binding to the command, but that is unfortunately no workaround since the command is missing from the menus.

          • Re: Readme markdown not rendering in Xcode
            MCStoufer_veeva Level 1 Level 1 (10 points)

            Place the .xcodesamplecode.plist in your foo.xcworkspace directory if you have a workspace named foo. If you are just working with a project, place it in your foo.xcodeproj dir.


            The content should be:

            <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array/> </plist>

            As soon as I did that, Xcode 11 immediately rendered my README file. It looked quite good too.


            I did not need to tweak the display mode for that file.

            Unfortunatley, local file navigation does not work, but external links do and the default browser in your system immediately navigates to them in a new tab. This content is also readonly, so I have to use MacDown to edit externally. Thankfully, saving the file immediately causes Xcode to re-render the new content.


            Good luck!